Skip to content

Commit 597d624

Browse files
jiangfeijimrollenhagen
authored andcommitted
Use _ instead of - for config options
Config options containing "-" don't work when reading configuration from a file; change these to "_". Leave the old options for backwards compatibility. Closes-Bug: #1386486 Change-Id: Ie10a548191effa2a505309d9d4ee32003f9676a2
1 parent e53e297 commit 597d624

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

ironic_python_agent/cmd/agent.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,59 +113,70 @@ def _get_vmedia_params():
113113
KPARAMS = _get_kernel_params()
114114

115115
cli_opts = [
116-
cfg.StrOpt('api-url',
116+
cfg.StrOpt('api_url',
117117
required=('ipa-api-url' not in KPARAMS),
118118
default=KPARAMS.get('ipa-api-url'),
119+
deprecated_name='api-url',
119120
help='URL of the Ironic API'),
120121

121-
cfg.StrOpt('listen-host',
122+
cfg.StrOpt('listen_host',
122123
default=KPARAMS.get('ipa-listen-host', '0.0.0.0'),
124+
deprecated_name='listen-host',
123125
help='The IP address to listen on.'),
124126

125-
cfg.IntOpt('listen-port',
127+
cfg.IntOpt('listen_port',
126128
default=int(KPARAMS.get('ipa-listen-port', 9999)),
129+
deprecated_name='listen-port',
127130
help='The port to listen on'),
128131

129-
cfg.StrOpt('advertise-host',
132+
cfg.StrOpt('advertise_host',
130133
default=KPARAMS.get('ipa-advertise-host', None),
134+
deprecated_name='advertise_host',
131135
help='The host to tell Ironic to reply and send '
132136
'commands to.'),
133137

134-
cfg.IntOpt('advertise-port',
138+
cfg.IntOpt('advertise_port',
135139
default=int(KPARAMS.get('ipa-advertise-port', 9999)),
140+
deprecated_name='advertise-port',
136141
help='The port to tell Ironic to reply and send '
137142
'commands to.'),
138143

139-
cfg.IntOpt('ip-lookup-attempts',
144+
cfg.IntOpt('ip_lookup_attempts',
140145
default=int(KPARAMS.get('ipa-ip-lookup-attempts', 3)),
146+
deprecated_name='ip-lookup-attempts',
141147
help='The number of times to try and automatically'
142148
'determine the agent IPv4 address.'),
143149

144-
cfg.IntOpt('ip-lookup-sleep',
150+
cfg.IntOpt('ip_lookup_sleep',
145151
default=int(KPARAMS.get('ipa-ip-lookup-timeout', 10)),
152+
deprecated_name='ip-lookup-sleep',
146153
help='The amaount of time to sleep between attempts'
147154
'to determine IP address.'),
148155

149-
cfg.StrOpt('network-interface',
156+
cfg.StrOpt('network_interface',
150157
default=KPARAMS.get('ipa-network-interface', None),
158+
deprecated_name='network-interface',
151159
help='The interface to use when looking for an IP'
152160
'address.'),
153161

154-
cfg.IntOpt('lookup-timeout',
162+
cfg.IntOpt('lookup_timeout',
155163
default=int(KPARAMS.get('ipa-lookup-timeout', 300)),
164+
deprecated_name='lookup-timeout',
156165
help='The amount of time to retry the initial lookup '
157166
'call to Ironic. After the timeout, the agent '
158167
'will exit with a non-zero exit code.'),
159168

160-
cfg.IntOpt('lookup-interval',
169+
cfg.IntOpt('lookup_interval',
161170
default=int(KPARAMS.get('ipa-lookup-timeout', 1)),
171+
deprecated_name='lookup-interval',
162172
help='The initial interval for retries on the initial '
163173
'lookup call to Ironic. The interval will be '
164174
'doubled after each failure until timeout is '
165175
'exceeded.'),
166176

167-
cfg.StrOpt('driver-name',
177+
cfg.StrOpt('driver_name',
168178
default=KPARAMS.get('ipa-driver-name', 'agent_ipmitool'),
179+
deprecated_name='driver-name',
169180
help='The Ironic driver in use for this node')
170181
]
171182

0 commit comments

Comments
 (0)