ironic-python-agent 10.2.2__py3-none-any.whl → 10.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ironic_python_agent/agent.py +62 -12
- ironic_python_agent/api/app.py +2 -12
- ironic_python_agent/config.py +7 -0
- ironic_python_agent/device_hints.py +53 -10
- ironic_python_agent/efi_utils.py +9 -2
- ironic_python_agent/extensions/image.py +20 -11
- ironic_python_agent/extensions/standby.py +2 -1
- ironic_python_agent/hardware.py +0 -16
- ironic_python_agent/tests/functional/base.py +6 -2
- ironic_python_agent/tests/functional/test_commands.py +7 -2
- ironic_python_agent/tests/unit/extensions/test_image.py +32 -0
- ironic_python_agent/tests/unit/test_agent.py +219 -11
- ironic_python_agent/tests/unit/test_api.py +17 -26
- ironic_python_agent/tests/unit/test_device_hints.py +35 -3
- ironic_python_agent/tests/unit/test_efi_utils.py +93 -0
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info}/METADATA +37 -26
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info}/RECORD +23 -23
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info}/WHEEL +1 -1
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info/licenses}/AUTHORS +1 -0
- ironic_python_agent-10.2.3.dist-info/pbr.json +1 -0
- ironic_python_agent-10.2.2.dist-info/pbr.json +0 -1
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info}/entry_points.txt +0 -0
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info/licenses}/LICENSE +0 -0
- {ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info}/top_level.txt +0 -0
ironic_python_agent/agent.py
CHANGED
|
@@ -26,6 +26,7 @@ import eventlet
|
|
|
26
26
|
from oslo_concurrency import processutils
|
|
27
27
|
from oslo_config import cfg
|
|
28
28
|
from oslo_log import log
|
|
29
|
+
import requests
|
|
29
30
|
|
|
30
31
|
from ironic_python_agent.api import app
|
|
31
32
|
from ironic_python_agent import config
|
|
@@ -39,6 +40,7 @@ from ironic_python_agent import mdns
|
|
|
39
40
|
from ironic_python_agent import netutils
|
|
40
41
|
from ironic_python_agent import utils
|
|
41
42
|
|
|
43
|
+
CONF = cfg.CONF
|
|
42
44
|
LOG = log.getLogger(__name__)
|
|
43
45
|
|
|
44
46
|
# Time(in seconds) to wait for any of the interfaces to be up
|
|
@@ -175,7 +177,10 @@ class IronicPythonAgentHeartbeater(threading.Thread):
|
|
|
175
177
|
"""Stop the heartbeat thread."""
|
|
176
178
|
LOG.info('stopping heartbeater')
|
|
177
179
|
self.stop_event.set()
|
|
178
|
-
|
|
180
|
+
# Only join if the thread was actually started
|
|
181
|
+
if self.is_alive():
|
|
182
|
+
return self.join()
|
|
183
|
+
return None
|
|
179
184
|
|
|
180
185
|
|
|
181
186
|
class IronicPythonAgent(base.ExecuteCommandMixin):
|
|
@@ -304,19 +309,59 @@ class IronicPythonAgent(base.ExecuteCommandMixin):
|
|
|
304
309
|
|
|
305
310
|
return source
|
|
306
311
|
|
|
312
|
+
def _test_ip_reachability(self, api_url):
|
|
313
|
+
"""Test if an API URL is reachable via HTTP GET request.
|
|
314
|
+
|
|
315
|
+
:param api_url: The full API URL to test (including protocol and port)
|
|
316
|
+
:returns: True if the URL is reachable, False otherwise
|
|
317
|
+
"""
|
|
318
|
+
try:
|
|
319
|
+
# Disable SSL verification for reachability testing only
|
|
320
|
+
response = requests.get(
|
|
321
|
+
api_url, timeout=CONF.http_request_timeout, verify=False
|
|
322
|
+
) # nosec
|
|
323
|
+
# Any HTTP response (even 404, 500, etc.) indicates reachability
|
|
324
|
+
LOG.debug('API URL %s is reachable (status: %s)',
|
|
325
|
+
api_url, response.status_code)
|
|
326
|
+
return True
|
|
327
|
+
except requests.exceptions.RequestException as e:
|
|
328
|
+
LOG.debug('API URL %s not reachable: %s', api_url, e)
|
|
329
|
+
return False
|
|
330
|
+
|
|
307
331
|
def _find_routable_addr(self):
|
|
332
|
+
# Process API URLs: check reachability and collect IPs in one pass
|
|
333
|
+
reachable_api_urls = []
|
|
308
334
|
ips = set()
|
|
335
|
+
|
|
309
336
|
for api_url in self.api_urls:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
337
|
+
parsed = urlparse.urlparse(api_url)
|
|
338
|
+
ironic_host = parsed.hostname
|
|
339
|
+
|
|
340
|
+
# Test reachability using the full URL (including port)
|
|
341
|
+
if self._test_ip_reachability(api_url):
|
|
342
|
+
reachable_api_urls.append(api_url)
|
|
343
|
+
LOG.debug('API URL %s is reachable', api_url)
|
|
344
|
+
|
|
345
|
+
# Collect IPs for reachable hosts
|
|
346
|
+
try:
|
|
347
|
+
addrs = socket.getaddrinfo(ironic_host, 0)
|
|
348
|
+
ips.update(addr for _, _, _, _, (addr, *_) in addrs)
|
|
349
|
+
except socket.gaierror:
|
|
350
|
+
LOG.debug('Could not resolve %s, maybe no DNS',
|
|
351
|
+
ironic_host)
|
|
352
|
+
ips.add(ironic_host)
|
|
353
|
+
else:
|
|
354
|
+
LOG.debug('API URL %s is not reachable, skipping', api_url)
|
|
355
|
+
|
|
356
|
+
# Update api_urls configuration to only include reachable endpoints
|
|
357
|
+
if reachable_api_urls:
|
|
358
|
+
LOG.info('Filtered API URLs from %d to %d reachable endpoints',
|
|
359
|
+
len(self.api_urls), len(reachable_api_urls))
|
|
360
|
+
self.api_urls = reachable_api_urls
|
|
361
|
+
else:
|
|
362
|
+
LOG.warning('No reachable Ironic API URLs found, keeping all URLs')
|
|
319
363
|
|
|
364
|
+
# Find routable address using collected IPs
|
|
320
365
|
for attempt in range(self.ip_lookup_attempts):
|
|
321
366
|
for ironic_host in ips:
|
|
322
367
|
found_ip = self._get_route_source(ironic_host)
|
|
@@ -455,6 +500,9 @@ class IronicPythonAgent(base.ExecuteCommandMixin):
|
|
|
455
500
|
|
|
456
501
|
# Update config with values from Ironic
|
|
457
502
|
config = content.get('config', {})
|
|
503
|
+
if config.get('enable_bios_bootloader_install'):
|
|
504
|
+
cfg.CONF.set_override('enable_bios_bootloader_install',
|
|
505
|
+
config['enable_bios_bootloader_install'])
|
|
458
506
|
if config.get('metrics'):
|
|
459
507
|
for opt, val in config.items():
|
|
460
508
|
setattr(cfg.CONF.metrics, opt, val)
|
|
@@ -566,13 +614,15 @@ class IronicPythonAgent(base.ExecuteCommandMixin):
|
|
|
566
614
|
# rescue operations.
|
|
567
615
|
LOG.info('Found rescue state marker file, locking down IPA '
|
|
568
616
|
'in disabled mode')
|
|
569
|
-
self.heartbeater.
|
|
617
|
+
if hasattr(self, 'heartbeater') and self.heartbeater.is_alive():
|
|
618
|
+
self.heartbeater.stop()
|
|
570
619
|
self.serve_api = False
|
|
571
620
|
while True:
|
|
572
621
|
time.sleep(100)
|
|
573
622
|
|
|
574
623
|
if not self.standalone and self.api_urls:
|
|
575
|
-
self.heartbeater.
|
|
624
|
+
if hasattr(self, 'heartbeater') and self.heartbeater.is_alive():
|
|
625
|
+
self.heartbeater.stop()
|
|
576
626
|
|
|
577
627
|
if self.lockdown:
|
|
578
628
|
self._lockdown_system()
|
ironic_python_agent/api/app.py
CHANGED
|
@@ -113,7 +113,6 @@ class Application(object):
|
|
|
113
113
|
routing.Rule('/commands/', endpoint='run_command',
|
|
114
114
|
methods=['POST']),
|
|
115
115
|
])
|
|
116
|
-
self.security_get_token_support = False
|
|
117
116
|
|
|
118
117
|
def __call__(self, environ, start_response):
|
|
119
118
|
"""WSGI entry point."""
|
|
@@ -203,13 +202,7 @@ class Application(object):
|
|
|
203
202
|
def require_agent_token_for_command(func):
|
|
204
203
|
def wrapper(self, request, *args, **kwargs):
|
|
205
204
|
token = request.args.get('agent_token', None)
|
|
206
|
-
if token:
|
|
207
|
-
# TODO(TheJulia): At some point down the road, remove the
|
|
208
|
-
# self.security_get_token_support flag and use the same
|
|
209
|
-
# decorator for the api_run_command endpoint.
|
|
210
|
-
self.security_get_token_support = True
|
|
211
|
-
if (self.security_get_token_support
|
|
212
|
-
and not self.agent.validate_agent_token(token)):
|
|
205
|
+
if not self.agent.validate_agent_token(token):
|
|
213
206
|
raise http_exc.Unauthorized('Token invalid.')
|
|
214
207
|
return func(self, request, *args, **kwargs)
|
|
215
208
|
return wrapper
|
|
@@ -231,15 +224,12 @@ class Application(object):
|
|
|
231
224
|
|
|
232
225
|
return jsonify(result)
|
|
233
226
|
|
|
227
|
+
@require_agent_token_for_command
|
|
234
228
|
def api_run_command(self, request):
|
|
235
229
|
body = request.get_json(force=True)
|
|
236
230
|
if ('name' not in body or 'params' not in body
|
|
237
231
|
or not isinstance(body['params'], dict)):
|
|
238
232
|
raise http_exc.BadRequest('Missing or invalid name or params')
|
|
239
|
-
token = request.args.get('agent_token', None)
|
|
240
|
-
if not self.agent.validate_agent_token(token):
|
|
241
|
-
raise http_exc.Unauthorized(
|
|
242
|
-
'Token invalid.')
|
|
243
233
|
with metrics_utils.get_metrics_logger(__name__).timer('run_command'):
|
|
244
234
|
result = self.agent.execute_command(body['name'], **body['params'])
|
|
245
235
|
wait = request.args.get('wait')
|
ironic_python_agent/config.py
CHANGED
|
@@ -393,6 +393,13 @@ cli_opts = [
|
|
|
393
393
|
help='This disables bootc deployment methods in the ramdisk '
|
|
394
394
|
'because the bootc command inside of the ramdisk '
|
|
395
395
|
'comes from the supplied image to be deployed.'),
|
|
396
|
+
cfg.BoolOpt('enable_bios_bootloader_install',
|
|
397
|
+
default=True,
|
|
398
|
+
help='Enables support for partition images which require a '
|
|
399
|
+
'legacy bootloader -- and a call to ``grub-install``. '
|
|
400
|
+
'Generally, this should remain disabled for maximum '
|
|
401
|
+
'security, however, this option allows it to be '
|
|
402
|
+
're-enabled for compatibility.'),
|
|
396
403
|
]
|
|
397
404
|
|
|
398
405
|
disk_utils_opts = [
|
|
@@ -191,11 +191,12 @@ def find_devices_by_hints(devices, root_device_hints):
|
|
|
191
191
|
:size: (Integer) Size of the device in *bytes*
|
|
192
192
|
:model: (String) Device model
|
|
193
193
|
:vendor: (String) Device vendor name
|
|
194
|
-
:serial: (String) Device serial number
|
|
195
|
-
:wwn: (String) Unique storage identifier
|
|
196
|
-
:wwn_with_extension: (String): Unique storage
|
|
197
|
-
the vendor extension appended
|
|
198
|
-
:wwn_vendor_extension: (String): United vendor
|
|
194
|
+
:serial: (String or List[String]) Device serial number(s)
|
|
195
|
+
:wwn: (String or List[String]) Unique storage identifier(s)
|
|
196
|
+
:wwn_with_extension: (String or List[String]): Unique storage
|
|
197
|
+
identifier(s) with the vendor extension appended
|
|
198
|
+
:wwn_vendor_extension: (String or List[String]): United vendor
|
|
199
|
+
storage identifier(s)
|
|
199
200
|
:rotational: (Boolean) Whether it's a rotational device or
|
|
200
201
|
not. Useful to distinguish HDDs (rotational) and SSDs
|
|
201
202
|
(not rotational).
|
|
@@ -221,6 +222,47 @@ def find_devices_by_hints(devices, root_device_hints):
|
|
|
221
222
|
device_value = dev.get(hint)
|
|
222
223
|
hint_value = parsed_hints[hint]
|
|
223
224
|
|
|
225
|
+
# Handle device attributes that are a list of strings
|
|
226
|
+
# (serial, wwn, wwn_with_extension, and wwn_vendor_extension).
|
|
227
|
+
if hint_type is str and isinstance(device_value, list):
|
|
228
|
+
# NOTE(mostepha): Device value is a list. Consider it matched
|
|
229
|
+
# if any value in the list matches the hint.
|
|
230
|
+
device_values = [v for v in device_value if v is not None]
|
|
231
|
+
if not device_values:
|
|
232
|
+
LOG.warning(
|
|
233
|
+
'The attribute "%(attr)s" of the device "%(dev)s" '
|
|
234
|
+
'has an empty value. Skipping device.',
|
|
235
|
+
{'attr': hint, 'dev': device_name})
|
|
236
|
+
break
|
|
237
|
+
|
|
238
|
+
matched = False
|
|
239
|
+
for val in device_values:
|
|
240
|
+
try:
|
|
241
|
+
normalized_val = _normalize_hint_expression(val, hint)
|
|
242
|
+
if specs_matcher.match(normalized_val, hint_value):
|
|
243
|
+
LOG.info('The attribute "%(attr)s" of device '
|
|
244
|
+
'"%(dev)s" matched hint %(hint)s with '
|
|
245
|
+
'value "%(value)s"',
|
|
246
|
+
{'attr': hint, 'dev': device_name,
|
|
247
|
+
'hint': hint_value, 'value': val})
|
|
248
|
+
matched = True
|
|
249
|
+
break
|
|
250
|
+
except ValueError:
|
|
251
|
+
# Skip invalid/empty values in the list
|
|
252
|
+
continue
|
|
253
|
+
|
|
254
|
+
# Continue to next hint if any value matched. Otherwise, break
|
|
255
|
+
# and try the next device.
|
|
256
|
+
if matched:
|
|
257
|
+
continue
|
|
258
|
+
else:
|
|
259
|
+
LOG.info('None of the values %(values)s for attribute '
|
|
260
|
+
'"%(attr)s" of device "%(dev)s" match the hint '
|
|
261
|
+
'%(hint)s',
|
|
262
|
+
{'values': device_values, 'attr': hint,
|
|
263
|
+
'dev': device_name, 'hint': hint_value})
|
|
264
|
+
break
|
|
265
|
+
|
|
224
266
|
if hint_type is str:
|
|
225
267
|
try:
|
|
226
268
|
device_value = _normalize_hint_expression(device_value,
|
|
@@ -286,11 +328,12 @@ def match_root_device_hints(devices, root_device_hints):
|
|
|
286
328
|
:size: (Integer) Size of the device in *bytes*
|
|
287
329
|
:model: (String) Device model
|
|
288
330
|
:vendor: (String) Device vendor name
|
|
289
|
-
:serial: (String) Device serial number
|
|
290
|
-
:wwn: (String) Unique storage identifier
|
|
291
|
-
:wwn_with_extension: (String): Unique storage
|
|
292
|
-
the vendor extension appended
|
|
293
|
-
:wwn_vendor_extension: (String): United vendor
|
|
331
|
+
:serial: (String or List[String]) Device serial number(s)
|
|
332
|
+
:wwn: (String or List[String]) Unique storage identifier(s)
|
|
333
|
+
:wwn_with_extension: (String or List[String]): Unique storage
|
|
334
|
+
identifier(s) with the vendor extension appended
|
|
335
|
+
:wwn_vendor_extension: (String or List[String]): United vendor
|
|
336
|
+
storage identifier(s)
|
|
294
337
|
:rotational: (Boolean) Whether it's a rotational device or
|
|
295
338
|
not. Useful to distinguish HDDs (rotational) and SSDs
|
|
296
339
|
(not rotational).
|
ironic_python_agent/efi_utils.py
CHANGED
|
@@ -285,8 +285,15 @@ def get_boot_records():
|
|
|
285
285
|
# Also ignore errors on decoding, as we can basically get
|
|
286
286
|
# garbage out of the nvram record, this way we don't fail
|
|
287
287
|
# hard on unrelated records.
|
|
288
|
-
cmd_output = efi_output[0].decode('utf-16', errors='ignore')
|
|
289
|
-
|
|
288
|
+
cmd_output = efi_output[0].decode('utf-16', errors='ignore').split('\n')
|
|
289
|
+
# Check that the output is encoded as UTF-16 otherwise try UTF-8.
|
|
290
|
+
_DETECT_ENCODING_STRING = "BootCurrent: "
|
|
291
|
+
for line in cmd_output:
|
|
292
|
+
if line.startswith(_DETECT_ENCODING_STRING):
|
|
293
|
+
break
|
|
294
|
+
else:
|
|
295
|
+
cmd_output = efi_output[0].decode('utf-8', errors='ignore').split('\n')
|
|
296
|
+
for line in cmd_output:
|
|
290
297
|
match = _ENTRY_LABEL.match(line)
|
|
291
298
|
if match is not None:
|
|
292
299
|
yield (match[1], match[2], match[4], match[3])
|
|
@@ -715,15 +715,24 @@ class ImageExtension(base.BaseAgentExtension):
|
|
|
715
715
|
' Assuming a whole disk image')
|
|
716
716
|
return
|
|
717
717
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
718
|
+
if CONF.enable_bios_bootloader_install:
|
|
719
|
+
# In case we can't use efibootmgr for uefi we will continue
|
|
720
|
+
# using grub2
|
|
721
|
+
LOG.debug('Using grub2-install to set up boot files')
|
|
722
|
+
try:
|
|
723
|
+
_install_grub2(device,
|
|
724
|
+
root_uuid=root_uuid,
|
|
725
|
+
efi_system_part_uuid=efi_system_part_uuid,
|
|
726
|
+
prep_boot_part_uuid=prep_boot_part_uuid,
|
|
727
|
+
target_boot_mode=target_boot_mode)
|
|
728
|
+
except Exception as e:
|
|
729
|
+
LOG.error('Error setting up bootloader. Error %s', e)
|
|
730
|
+
if not ignore_failure:
|
|
731
|
+
raise
|
|
732
|
+
else:
|
|
733
|
+
msg = ("Install of legacy BIOS bootloaders disabled by "
|
|
734
|
+
"CONF.enable_bios_bootloader_install as part of "
|
|
735
|
+
"CVE-2026-43003 mitigation.")
|
|
736
|
+
LOG.error(msg)
|
|
728
737
|
if not ignore_failure:
|
|
729
|
-
raise
|
|
738
|
+
raise errors.InvalidImage(details=msg)
|
|
@@ -843,7 +843,8 @@ def _validate_partitioning(device):
|
|
|
843
843
|
except (processutils.UnknownArgumentError,
|
|
844
844
|
processutils.ProcessExecutionError, OSError) as e:
|
|
845
845
|
msg = ("Unable to find a valid partition table on the disk after "
|
|
846
|
-
|
|
846
|
+
"writing the image. The image may be corrupted or it uses a "
|
|
847
|
+
f"different sector size than the device. Error: {e}")
|
|
847
848
|
raise errors.DeploymentError(msg)
|
|
848
849
|
|
|
849
850
|
# Check if there is at least one partition in the partition table after
|
ironic_python_agent/hardware.py
CHANGED
|
@@ -1765,22 +1765,6 @@ class GenericHardwareManager(HardwareManager):
|
|
|
1765
1765
|
dev_name = utils.guess_root_disk(block_devices).name
|
|
1766
1766
|
else:
|
|
1767
1767
|
serialized_devs = [dev.serialize() for dev in block_devices]
|
|
1768
|
-
orig_size = len(serialized_devs)
|
|
1769
|
-
for dev_idx in range(orig_size):
|
|
1770
|
-
ser_dev = serialized_devs.pop(0)
|
|
1771
|
-
serials = ser_dev.get('serial')
|
|
1772
|
-
wwns = ser_dev.get('wwn')
|
|
1773
|
-
# (rozzi) static serial and static wwn are used to avoid
|
|
1774
|
-
# reundancy in the number of wwns and serials, if the code
|
|
1775
|
-
# would just loop over both serials and wwns it could be that
|
|
1776
|
-
# there would be an uncesarry duplication of the first wwn
|
|
1777
|
-
# number
|
|
1778
|
-
for serial in serials:
|
|
1779
|
-
for wwn in wwns:
|
|
1780
|
-
tmp_ser_dev = ser_dev.copy()
|
|
1781
|
-
tmp_ser_dev['wwn'] = wwn
|
|
1782
|
-
tmp_ser_dev['serial'] = serial
|
|
1783
|
-
serialized_devs.append(tmp_ser_dev)
|
|
1784
1768
|
try:
|
|
1785
1769
|
device = device_hints.match_root_device_hints(
|
|
1786
1770
|
serialized_devs, root_device_hints)
|
|
@@ -38,6 +38,7 @@ class FunctionalBase(test_base.BaseTestCase):
|
|
|
38
38
|
# Build a basic standalone agent using the config option defaults.
|
|
39
39
|
# 127.0.0.1:6835 is the fake Ironic client.
|
|
40
40
|
|
|
41
|
+
self.agent_token = '678123'
|
|
41
42
|
self.agent = agent.IronicPythonAgent(
|
|
42
43
|
api_url='http://127.0.0.1:6835',
|
|
43
44
|
advertise_address=agent.Host('localhost', 9999),
|
|
@@ -49,7 +50,7 @@ class FunctionalBase(test_base.BaseTestCase):
|
|
|
49
50
|
lookup_timeout=300,
|
|
50
51
|
lookup_interval=1,
|
|
51
52
|
standalone=True,
|
|
52
|
-
agent_token=
|
|
53
|
+
agent_token=self.agent_token)
|
|
53
54
|
self.process = multiprocessing.Process(
|
|
54
55
|
target=self.agent.run)
|
|
55
56
|
self.process.start()
|
|
@@ -70,7 +71,7 @@ class FunctionalBase(test_base.BaseTestCase):
|
|
|
70
71
|
% (max_tries * sleep_time))
|
|
71
72
|
|
|
72
73
|
def request(self, method, path, expect_error=None, expect_json=True,
|
|
73
|
-
**kwargs):
|
|
74
|
+
with_token=True, **kwargs):
|
|
74
75
|
"""Send a request to the agent and verifies response.
|
|
75
76
|
|
|
76
77
|
:param method: type of request to send as a string
|
|
@@ -85,6 +86,9 @@ class FunctionalBase(test_base.BaseTestCase):
|
|
|
85
86
|
expect_error
|
|
86
87
|
:returns: the response object
|
|
87
88
|
"""
|
|
89
|
+
if with_token:
|
|
90
|
+
separator = '&' if '?' in path else '?'
|
|
91
|
+
path = f'{path}{separator}agent_token={self.agent_token}'
|
|
88
92
|
res = requests.request(method, 'http://localhost:%s/v1/%s' %
|
|
89
93
|
(self.test_port, path), **kwargs)
|
|
90
94
|
if expect_error is not None:
|
|
@@ -26,6 +26,11 @@ class TestCommands(base.FunctionalBase):
|
|
|
26
26
|
|
|
27
27
|
node = {'uuid': '1', 'properties': {}, 'instance_info': {}}
|
|
28
28
|
|
|
29
|
+
def step_0_agent_token_required(self):
|
|
30
|
+
"""Validate that the agent token is required at startup."""
|
|
31
|
+
self.request(method='get', path='commands',
|
|
32
|
+
expect_error=401, with_token=False)
|
|
33
|
+
|
|
29
34
|
def step_1_get_empty_commands(self):
|
|
30
35
|
response = self.request('get', 'commands')
|
|
31
36
|
self.assertEqual({'commands': []}, response)
|
|
@@ -37,7 +42,7 @@ class TestCommands(base.FunctionalBase):
|
|
|
37
42
|
# success is required for steps 3 and 4 to succeed.
|
|
38
43
|
command = {'name': 'clean.get_clean_steps',
|
|
39
44
|
'params': {'node': self.node, 'ports': {}}}
|
|
40
|
-
response = self.request('post', 'commands
|
|
45
|
+
response = self.request('post', 'commands/',
|
|
41
46
|
json=command,
|
|
42
47
|
headers={'Content-Type': 'application/json'})
|
|
43
48
|
self.assertIsNone(response['command_error'])
|
|
@@ -64,7 +69,7 @@ class TestCommands(base.FunctionalBase):
|
|
|
64
69
|
|
|
65
70
|
def step_5_run_non_existent_command(self):
|
|
66
71
|
fake_command = {'name': 'bad_extension.fake_command', 'params': {}}
|
|
67
|
-
self.request('post', 'commands
|
|
72
|
+
self.request('post', 'commands/',
|
|
68
73
|
expect_error=404, json=fake_command)
|
|
69
74
|
|
|
70
75
|
def positive_get_post_command_steps(self):
|
|
@@ -52,6 +52,7 @@ class TestImageExtension(base.IronicAgentTest):
|
|
|
52
52
|
self.fake_efi_system_part_uuid = '45AB-2312'
|
|
53
53
|
self.fake_prep_boot_part_uuid = '76937797-3253-8843-999999999999'
|
|
54
54
|
self.fake_dir = '/tmp/fake-dir'
|
|
55
|
+
self.config(enable_bios_bootloader_install=True)
|
|
55
56
|
|
|
56
57
|
@mock.patch.object(image, '_install_grub2', autospec=True)
|
|
57
58
|
def test__install_bootloader_bios(self, mock_grub2,
|
|
@@ -68,8 +69,39 @@ class TestImageExtension(base.IronicAgentTest):
|
|
|
68
69
|
self.fake_dev, root_uuid=self.fake_root_uuid,
|
|
69
70
|
efi_system_part_uuid=None, prep_boot_part_uuid=None,
|
|
70
71
|
target_boot_mode='bios'
|
|
72
|
+
|
|
71
73
|
)
|
|
72
74
|
|
|
75
|
+
@mock.patch.object(image, '_install_grub2', autospec=True)
|
|
76
|
+
def test__install_bootloader_bios_disabled(self, mock_grub2,
|
|
77
|
+
mock_execute, mock_dispatch):
|
|
78
|
+
self.config(enable_bios_bootloader_install=False)
|
|
79
|
+
mock_dispatch.side_effect = [
|
|
80
|
+
self.fake_dev, hardware.BootInfo(current_boot_mode='bios')
|
|
81
|
+
]
|
|
82
|
+
self.agent_extension.install_bootloader(
|
|
83
|
+
root_uuid=self.fake_root_uuid).join()
|
|
84
|
+
mock_dispatch.assert_any_call('get_os_install_device')
|
|
85
|
+
mock_dispatch.assert_any_call('get_boot_info')
|
|
86
|
+
self.assertEqual(2, mock_dispatch.call_count)
|
|
87
|
+
mock_grub2.assert_not_called()
|
|
88
|
+
|
|
89
|
+
@mock.patch.object(image, '_install_grub2', autospec=True)
|
|
90
|
+
def test__install_bootloader_bios_disabled_dont_ignore_failures(
|
|
91
|
+
self, mock_grub2, mock_execute, mock_dispatch):
|
|
92
|
+
self.config(enable_bios_bootloader_install=False)
|
|
93
|
+
self.config(ignore_bootloader_failure=False)
|
|
94
|
+
mock_dispatch.side_effect = [
|
|
95
|
+
self.fake_dev, hardware.BootInfo(current_boot_mode='bios')
|
|
96
|
+
]
|
|
97
|
+
result = self.agent_extension.install_bootloader(
|
|
98
|
+
root_uuid=self.fake_root_uuid).join()
|
|
99
|
+
mock_dispatch.assert_any_call('get_os_install_device')
|
|
100
|
+
mock_dispatch.assert_any_call('get_boot_info')
|
|
101
|
+
self.assertEqual(2, mock_dispatch.call_count)
|
|
102
|
+
self.assertIsNotNone(result.command_error)
|
|
103
|
+
mock_grub2.assert_not_called()
|
|
104
|
+
|
|
73
105
|
@mock.patch.object(efi_utils, 'manage_uefi', autospec=True)
|
|
74
106
|
@mock.patch.object(image, '_install_grub2', autospec=True)
|
|
75
107
|
def test__install_bootloader_uefi(self, mock_grub2, mock_uefi,
|
|
@@ -21,6 +21,7 @@ from unittest.mock import sentinel
|
|
|
21
21
|
|
|
22
22
|
from oslo_concurrency import processutils
|
|
23
23
|
from oslo_config import cfg
|
|
24
|
+
import requests
|
|
24
25
|
from stevedore import extension
|
|
25
26
|
|
|
26
27
|
from ironic_python_agent import agent
|
|
@@ -183,6 +184,25 @@ class TestHeartbeater(ironic_agent_base.IronicAgentTest):
|
|
|
183
184
|
mock_time.return_value = 110
|
|
184
185
|
self.assertTrue(self.heartbeater._heartbeat_expected())
|
|
185
186
|
|
|
187
|
+
def test_stop_not_started(self):
|
|
188
|
+
"""Test stop() when thread was never started."""
|
|
189
|
+
# Thread is not alive, should not call join()
|
|
190
|
+
self.assertFalse(self.heartbeater.is_alive())
|
|
191
|
+
result = self.heartbeater.stop()
|
|
192
|
+
self.assertIsNone(result)
|
|
193
|
+
self.assertTrue(self.heartbeater.stop_event.set.called)
|
|
194
|
+
|
|
195
|
+
@mock.patch.object(agent.IronicPythonAgentHeartbeater, 'join',
|
|
196
|
+
autospec=True)
|
|
197
|
+
def test_stop_when_alive(self, mock_join):
|
|
198
|
+
"""Test stop() when thread is alive."""
|
|
199
|
+
# Mock the thread as alive
|
|
200
|
+
with mock.patch.object(self.heartbeater, 'is_alive',
|
|
201
|
+
autospec=True, return_value=True):
|
|
202
|
+
self.heartbeater.stop()
|
|
203
|
+
mock_join.assert_called_once_with(self.heartbeater)
|
|
204
|
+
self.assertTrue(self.heartbeater.stop_event.set.called)
|
|
205
|
+
|
|
186
206
|
|
|
187
207
|
@mock.patch.object(hardware, '_md_scan_and_assemble', lambda: None)
|
|
188
208
|
@mock.patch.object(hardware, '_check_for_iscsi', lambda: None)
|
|
@@ -865,6 +885,49 @@ class TestBaseAgent(ironic_agent_base.IronicAgentTest):
|
|
|
865
885
|
mock.call('wait_for_disks')],
|
|
866
886
|
mock_dispatch.call_args_list)
|
|
867
887
|
|
|
888
|
+
@mock.patch(
|
|
889
|
+
'ironic_python_agent.hardware_managers.cna._detect_cna_card',
|
|
890
|
+
mock.Mock())
|
|
891
|
+
@mock.patch('os.path.exists', autospec=True)
|
|
892
|
+
@mock.patch.object(hardware, 'get_managers', autospec=True)
|
|
893
|
+
@mock.patch.object(time, 'sleep', autospec=True)
|
|
894
|
+
@mock.patch.object(agent.IronicPythonAgent, '_wait_for_interface',
|
|
895
|
+
autospec=True)
|
|
896
|
+
@mock.patch.object(hardware, 'dispatch_to_managers', autospec=True)
|
|
897
|
+
def test_run_rescue_mode_heartbeater_not_started(
|
|
898
|
+
self, mock_dispatch, mock_wait, mock_sleep, mock_get_managers,
|
|
899
|
+
mock_exists):
|
|
900
|
+
"""Test rescue mode doesn't fail when heartbeater not started."""
|
|
901
|
+
CONF.set_override('inspection_callback_url', '')
|
|
902
|
+
|
|
903
|
+
# Mock rescue mode marker file exists
|
|
904
|
+
mock_exists.return_value = True
|
|
905
|
+
|
|
906
|
+
self.agent.heartbeater = mock.Mock()
|
|
907
|
+
self.agent.heartbeater.is_alive.return_value = False
|
|
908
|
+
self.agent.api_client.lookup_node = mock.Mock()
|
|
909
|
+
self.agent.api_client.lookup_node.return_value = {
|
|
910
|
+
'node': {
|
|
911
|
+
'uuid': 'deadbeef-dabb-ad00-b105-f00d00bab10c'
|
|
912
|
+
},
|
|
913
|
+
'config': {
|
|
914
|
+
'heartbeat_timeout': 300
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
# Setup to exit the infinite loop after first iteration
|
|
919
|
+
mock_sleep.side_effect = [None, KeyboardInterrupt()]
|
|
920
|
+
|
|
921
|
+
try:
|
|
922
|
+
self.agent.run()
|
|
923
|
+
except KeyboardInterrupt:
|
|
924
|
+
pass
|
|
925
|
+
|
|
926
|
+
# Heartbeater should not be started or stopped in rescue mode
|
|
927
|
+
self.agent.heartbeater.start.assert_not_called()
|
|
928
|
+
self.agent.heartbeater.stop.assert_not_called()
|
|
929
|
+
self.assertFalse(self.agent.serve_api)
|
|
930
|
+
|
|
868
931
|
def test_async_command_success(self):
|
|
869
932
|
result = base.AsyncCommandResult('foo_command', {'fail': False},
|
|
870
933
|
foo_execute)
|
|
@@ -952,6 +1015,123 @@ class TestBaseAgent(ironic_agent_base.IronicAgentTest):
|
|
|
952
1015
|
self.assertIsNone(source)
|
|
953
1016
|
mock_log.warning.assert_called_once()
|
|
954
1017
|
|
|
1018
|
+
@mock.patch('requests.get', autospec=True)
|
|
1019
|
+
def test_test_ip_reachability_success(self, mock_get):
|
|
1020
|
+
"""Test _test_ip_reachability with successful HTTP response."""
|
|
1021
|
+
mock_response = mock.Mock()
|
|
1022
|
+
mock_response.status_code = 200
|
|
1023
|
+
mock_get.return_value = mock_response
|
|
1024
|
+
|
|
1025
|
+
result = self.agent._test_ip_reachability('http://192.168.1.1:6385/v1')
|
|
1026
|
+
self.assertTrue(result)
|
|
1027
|
+
mock_get.assert_called_once_with('http://192.168.1.1:6385/v1',
|
|
1028
|
+
timeout=30, verify=False)
|
|
1029
|
+
|
|
1030
|
+
@mock.patch('requests.get', autospec=True)
|
|
1031
|
+
def test_test_ip_reachability_https_success(self, mock_get):
|
|
1032
|
+
"""Test _test_ip_reachability with HTTPS URL."""
|
|
1033
|
+
mock_response = mock.Mock()
|
|
1034
|
+
mock_response.status_code = 404 # Any status code is acceptable
|
|
1035
|
+
mock_get.return_value = mock_response
|
|
1036
|
+
|
|
1037
|
+
result = self.agent._test_ip_reachability(
|
|
1038
|
+
'https://192.168.1.1:6385/v1')
|
|
1039
|
+
self.assertTrue(result)
|
|
1040
|
+
mock_get.assert_called_once_with('https://192.168.1.1:6385/v1',
|
|
1041
|
+
timeout=30, verify=False)
|
|
1042
|
+
|
|
1043
|
+
@mock.patch('requests.get', autospec=True)
|
|
1044
|
+
def test_test_ip_reachability_failure(self, mock_get):
|
|
1045
|
+
"""Test _test_ip_reachability with connection failure."""
|
|
1046
|
+
mock_get.side_effect = requests.exceptions.ConnectionError(
|
|
1047
|
+
'Connection failed')
|
|
1048
|
+
|
|
1049
|
+
result = self.agent._test_ip_reachability('http://192.168.1.1:6385/v1')
|
|
1050
|
+
self.assertFalse(result)
|
|
1051
|
+
mock_get.assert_called_once_with('http://192.168.1.1:6385/v1',
|
|
1052
|
+
timeout=30, verify=False)
|
|
1053
|
+
|
|
1054
|
+
@mock.patch('requests.get', autospec=True)
|
|
1055
|
+
@mock.patch.object(socket, 'getaddrinfo', autospec=True)
|
|
1056
|
+
@mock.patch.object(utils, 'execute', autospec=True)
|
|
1057
|
+
def test_find_routable_addr_filters_api_urls(self, mock_exec,
|
|
1058
|
+
mock_getaddrinfo,
|
|
1059
|
+
mock_requests_get):
|
|
1060
|
+
"""Test that _find_routable_addr filters unreachable API URLs."""
|
|
1061
|
+
# Set up multiple API URLs - some reachable, some not
|
|
1062
|
+
self.agent.api_urls = [
|
|
1063
|
+
'http://reachable1.example.com:8081/v1',
|
|
1064
|
+
'http://unreachable.example.com:8081/v1',
|
|
1065
|
+
'http://reachable2.example.com:8081/v1'
|
|
1066
|
+
]
|
|
1067
|
+
|
|
1068
|
+
# Mock reachability tests - only reachable1 and reachable2 are
|
|
1069
|
+
# reachable
|
|
1070
|
+
def mock_reachability_side_effect(url, **kwargs):
|
|
1071
|
+
mock_response = mock.Mock()
|
|
1072
|
+
mock_response.status_code = 200
|
|
1073
|
+
if 'reachable1' in url or 'reachable2' in url:
|
|
1074
|
+
return mock_response
|
|
1075
|
+
else:
|
|
1076
|
+
raise requests.exceptions.ConnectionError('Connection failed')
|
|
1077
|
+
|
|
1078
|
+
mock_requests_get.side_effect = mock_reachability_side_effect
|
|
1079
|
+
|
|
1080
|
+
# Mock DNS resolution for reachable hosts
|
|
1081
|
+
mock_getaddrinfo.return_value = [
|
|
1082
|
+
(sentinel.a, sentinel.b, sentinel.c, sentinel.d,
|
|
1083
|
+
('192.168.1.1', sentinel.e)),
|
|
1084
|
+
]
|
|
1085
|
+
|
|
1086
|
+
# Mock successful route lookup
|
|
1087
|
+
mock_exec.return_value = (
|
|
1088
|
+
"""192.168.1.1 via 192.168.122.1 dev eth0 src 192.168.122.56
|
|
1089
|
+
cache """,
|
|
1090
|
+
""
|
|
1091
|
+
)
|
|
1092
|
+
|
|
1093
|
+
result = self.agent._find_routable_addr()
|
|
1094
|
+
|
|
1095
|
+
# Should return the found IP
|
|
1096
|
+
self.assertEqual('192.168.122.56', result)
|
|
1097
|
+
|
|
1098
|
+
# Should have filtered API URLs to only include reachable ones
|
|
1099
|
+
self.assertEqual(2, len(self.agent.api_urls))
|
|
1100
|
+
self.assertIn('http://reachable1.example.com:8081/v1',
|
|
1101
|
+
self.agent.api_urls)
|
|
1102
|
+
self.assertIn('http://reachable2.example.com:8081/v1',
|
|
1103
|
+
self.agent.api_urls)
|
|
1104
|
+
self.assertNotIn('http://unreachable.example.com:8081/v1',
|
|
1105
|
+
self.agent.api_urls)
|
|
1106
|
+
|
|
1107
|
+
@mock.patch('requests.get', autospec=True)
|
|
1108
|
+
@mock.patch.object(utils, 'execute', autospec=True)
|
|
1109
|
+
def test_find_routable_addr_no_reachable_urls(self, mock_exec,
|
|
1110
|
+
mock_requests_get):
|
|
1111
|
+
"""Test _find_routable_addr when no API URLs are reachable."""
|
|
1112
|
+
# Set up API URLs that are all unreachable
|
|
1113
|
+
self.agent.api_urls = [
|
|
1114
|
+
'http://unreachable1.example.com:8081/v1',
|
|
1115
|
+
'http://unreachable2.example.com:8081/v1'
|
|
1116
|
+
]
|
|
1117
|
+
|
|
1118
|
+
# Mock all reachability tests to fail
|
|
1119
|
+
mock_requests_get.side_effect = requests.exceptions.ConnectionError(
|
|
1120
|
+
'Connection failed')
|
|
1121
|
+
|
|
1122
|
+
# Mock execute to raise an exception (no route found)
|
|
1123
|
+
mock_exec.side_effect = processutils.ProcessExecutionError('No route')
|
|
1124
|
+
|
|
1125
|
+
# Should keep original URLs with warning
|
|
1126
|
+
original_urls = self.agent.api_urls.copy()
|
|
1127
|
+
result = self.agent._find_routable_addr()
|
|
1128
|
+
|
|
1129
|
+
# Should return None (no routable address found)
|
|
1130
|
+
self.assertIsNone(result)
|
|
1131
|
+
|
|
1132
|
+
# Should keep original URLs when none are reachable
|
|
1133
|
+
self.assertEqual(original_urls, self.agent.api_urls)
|
|
1134
|
+
|
|
955
1135
|
|
|
956
1136
|
@mock.patch.object(hardware, '_md_scan_and_assemble', lambda: None)
|
|
957
1137
|
@mock.patch.object(hardware, '_check_for_iscsi', lambda: None)
|
|
@@ -1058,6 +1238,7 @@ class TestAgentStandalone(ironic_agent_base.IronicAgentTest):
|
|
|
1058
1238
|
@mock.patch.object(hardware, '_load_ipmi_modules', lambda: None)
|
|
1059
1239
|
@mock.patch.object(hardware.GenericHardwareManager, 'wait_for_disks',
|
|
1060
1240
|
lambda self: None)
|
|
1241
|
+
@mock.patch('requests.get', autospec=True)
|
|
1061
1242
|
@mock.patch.object(socket, 'getaddrinfo', autospec=True)
|
|
1062
1243
|
@mock.patch.object(utils, 'execute', autospec=True)
|
|
1063
1244
|
class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
@@ -1076,7 +1257,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1076
1257
|
agent_token=None,
|
|
1077
1258
|
standalone=False)
|
|
1078
1259
|
|
|
1079
|
-
def test_advertise_address_provided(self, mock_exec, mock_getaddrinfo
|
|
1260
|
+
def test_advertise_address_provided(self, mock_exec, mock_getaddrinfo,
|
|
1261
|
+
mock_requests_get):
|
|
1080
1262
|
self.agent.advertise_address = agent.Host('1.2.3.4', 9990)
|
|
1081
1263
|
|
|
1082
1264
|
self.agent.set_agent_advertise_addr()
|
|
@@ -1090,8 +1272,10 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1090
1272
|
autospec=True)
|
|
1091
1273
|
@mock.patch('ironic_python_agent.hardware_managers.cna._detect_cna_card',
|
|
1092
1274
|
autospec=True)
|
|
1093
|
-
def test_with_network_interface(self, mock_cna,
|
|
1094
|
-
|
|
1275
|
+
def test_with_network_interface(self, mock_cna,
|
|
1276
|
+
mock_get_ipv4, mock_mpath,
|
|
1277
|
+
mock_exec, mock_getaddrinfo,
|
|
1278
|
+
mock_requests_get):
|
|
1095
1279
|
self.agent.network_interface = 'em1'
|
|
1096
1280
|
mock_get_ipv4.return_value = '1.2.3.4'
|
|
1097
1281
|
mock_cna.return_value = False
|
|
@@ -1111,7 +1295,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1111
1295
|
autospec=True)
|
|
1112
1296
|
def test_with_network_interface_failed(self, mock_cna, mock_get_ipv4,
|
|
1113
1297
|
mock_mpath, mock_exec,
|
|
1114
|
-
mock_getaddrinfo
|
|
1298
|
+
mock_getaddrinfo,
|
|
1299
|
+
mock_requests_get):
|
|
1115
1300
|
self.agent.network_interface = 'em1'
|
|
1116
1301
|
mock_get_ipv4.return_value = None
|
|
1117
1302
|
mock_cna.return_value = False
|
|
@@ -1123,7 +1308,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1123
1308
|
self.assertFalse(mock_exec.called)
|
|
1124
1309
|
self.assertFalse(mock_getaddrinfo.called)
|
|
1125
1310
|
|
|
1126
|
-
def test_route_with_ip(self, mock_exec, mock_getaddrinfo
|
|
1311
|
+
def test_route_with_ip(self, mock_exec, mock_getaddrinfo,
|
|
1312
|
+
mock_requests_get):
|
|
1127
1313
|
self.agent.api_urls = ['http://1.2.1.2:8081/v1']
|
|
1128
1314
|
mock_getaddrinfo.side_effect = socket.gaierror()
|
|
1129
1315
|
mock_exec.return_value = (
|
|
@@ -1131,6 +1317,10 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1131
1317
|
cache """,
|
|
1132
1318
|
""
|
|
1133
1319
|
)
|
|
1320
|
+
# Mock successful HTTP reachability test
|
|
1321
|
+
mock_response = mock.Mock()
|
|
1322
|
+
mock_response.status_code = 200
|
|
1323
|
+
mock_requests_get.return_value = mock_response
|
|
1134
1324
|
|
|
1135
1325
|
self.agent.set_agent_advertise_addr()
|
|
1136
1326
|
|
|
@@ -1139,7 +1329,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1139
1329
|
mock_exec.assert_called_once_with('ip', 'route', 'get', '1.2.1.2')
|
|
1140
1330
|
mock_getaddrinfo.assert_called_once_with('1.2.1.2', 0)
|
|
1141
1331
|
|
|
1142
|
-
def test_route_with_ipv6(self, mock_exec, mock_getaddrinfo
|
|
1332
|
+
def test_route_with_ipv6(self, mock_exec, mock_getaddrinfo,
|
|
1333
|
+
mock_requests_get):
|
|
1143
1334
|
self.agent.api_urls = ['http://[fc00:1111::1]:8081/v1']
|
|
1144
1335
|
mock_getaddrinfo.side_effect = socket.gaierror()
|
|
1145
1336
|
mock_exec.return_value = (
|
|
@@ -1147,6 +1338,10 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1147
1338
|
cache """,
|
|
1148
1339
|
""
|
|
1149
1340
|
)
|
|
1341
|
+
# Mock successful HTTP reachability test
|
|
1342
|
+
mock_response = mock.Mock()
|
|
1343
|
+
mock_response.status_code = 200
|
|
1344
|
+
mock_requests_get.return_value = mock_response
|
|
1150
1345
|
|
|
1151
1346
|
self.agent.set_agent_advertise_addr()
|
|
1152
1347
|
|
|
@@ -1155,7 +1350,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1155
1350
|
mock_exec.assert_called_once_with('ip', 'route', 'get', 'fc00:1111::1')
|
|
1156
1351
|
mock_getaddrinfo.assert_called_once_with('fc00:1111::1', 0)
|
|
1157
1352
|
|
|
1158
|
-
def test_route_with_host(self, mock_exec, mock_getaddrinfo
|
|
1353
|
+
def test_route_with_host(self, mock_exec, mock_getaddrinfo,
|
|
1354
|
+
mock_requests_get):
|
|
1159
1355
|
mock_getaddrinfo.return_value = [
|
|
1160
1356
|
(sentinel.a, sentinel.b, sentinel.c, sentinel.d,
|
|
1161
1357
|
('1.2.1.2', sentinel.e)),
|
|
@@ -1165,6 +1361,10 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1165
1361
|
cache """,
|
|
1166
1362
|
""
|
|
1167
1363
|
)
|
|
1364
|
+
# Mock successful HTTP reachability test
|
|
1365
|
+
mock_response = mock.Mock()
|
|
1366
|
+
mock_response.status_code = 200
|
|
1367
|
+
mock_requests_get.return_value = mock_response
|
|
1168
1368
|
|
|
1169
1369
|
self.agent.set_agent_advertise_addr()
|
|
1170
1370
|
|
|
@@ -1173,7 +1373,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1173
1373
|
mock_exec.assert_called_once_with('ip', 'route', 'get', '1.2.1.2')
|
|
1174
1374
|
mock_getaddrinfo.assert_called_once_with('fake_api.example.org', 0)
|
|
1175
1375
|
|
|
1176
|
-
def test_route_with_host_v6(self, mock_exec, mock_getaddrinfo
|
|
1376
|
+
def test_route_with_host_v6(self, mock_exec, mock_getaddrinfo,
|
|
1377
|
+
mock_requests_get):
|
|
1177
1378
|
mock_getaddrinfo.return_value = [
|
|
1178
1379
|
(sentinel.a, sentinel.b, sentinel.c, sentinel.d,
|
|
1179
1380
|
('fc00:1111::1', sentinel.e)),
|
|
@@ -1183,6 +1384,10 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1183
1384
|
cache """,
|
|
1184
1385
|
""
|
|
1185
1386
|
)
|
|
1387
|
+
# Mock successful HTTP reachability test
|
|
1388
|
+
mock_response = mock.Mock()
|
|
1389
|
+
mock_response.status_code = 200
|
|
1390
|
+
mock_requests_get.return_value = mock_response
|
|
1186
1391
|
|
|
1187
1392
|
self.agent.set_agent_advertise_addr()
|
|
1188
1393
|
|
|
@@ -1192,7 +1397,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1192
1397
|
mock_getaddrinfo.assert_called_once_with('fake_api.example.org', 0)
|
|
1193
1398
|
|
|
1194
1399
|
@mock.patch.object(time, 'sleep', autospec=True)
|
|
1195
|
-
def test_route_retry(self, mock_sleep, mock_exec, mock_getaddrinfo
|
|
1400
|
+
def test_route_retry(self, mock_sleep, mock_exec, mock_getaddrinfo,
|
|
1401
|
+
mock_requests_get):
|
|
1196
1402
|
mock_getaddrinfo.return_value = [
|
|
1197
1403
|
(sentinel.a, sentinel.b, sentinel.c, sentinel.d,
|
|
1198
1404
|
('1.2.1.2', sentinel.e)),
|
|
@@ -1222,7 +1428,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1222
1428
|
|
|
1223
1429
|
@mock.patch.object(time, 'sleep', autospec=True)
|
|
1224
1430
|
def test_route_several_urls_and_retries(self, mock_sleep, mock_exec,
|
|
1225
|
-
mock_getaddrinfo
|
|
1431
|
+
mock_getaddrinfo,
|
|
1432
|
+
mock_requests_get):
|
|
1226
1433
|
mock_getaddrinfo.side_effect = lambda addr, port: [
|
|
1227
1434
|
(sentinel.a, sentinel.b, sentinel.c, sentinel.d,
|
|
1228
1435
|
(addr, sentinel.e)),
|
|
@@ -1267,7 +1474,8 @@ class TestAdvertiseAddress(ironic_agent_base.IronicAgentTest):
|
|
|
1267
1474
|
self.assertEqual(2, mock_getaddrinfo.call_count)
|
|
1268
1475
|
|
|
1269
1476
|
@mock.patch.object(time, 'sleep', autospec=True)
|
|
1270
|
-
def test_route_failed(self, mock_sleep, mock_exec, mock_getaddrinfo
|
|
1477
|
+
def test_route_failed(self, mock_sleep, mock_exec, mock_getaddrinfo,
|
|
1478
|
+
mock_requests_get):
|
|
1271
1479
|
mock_getaddrinfo.return_value = [
|
|
1272
1480
|
(sentinel.a, sentinel.b, sentinel.c, sentinel.d,
|
|
1273
1481
|
('1.2.1.2', sentinel.e)),
|
|
@@ -329,46 +329,37 @@ class TestIronicAPI(ironic_agent_base.IronicAgentTest):
|
|
|
329
329
|
self.assertEqual(1, self.mock_agent.validate_agent_token.call_count)
|
|
330
330
|
self.assertEqual(0, self.mock_agent.get_command_result.call_count)
|
|
331
331
|
|
|
332
|
-
def
|
|
333
|
-
"""Tests
|
|
332
|
+
def test_get_command_requires_token_without_one(self):
|
|
333
|
+
"""Tests LP#2160196: GET must not skip validation without a token.
|
|
334
|
+
|
|
335
|
+
GET endpoints must always call validate_agent_token, even when
|
|
336
|
+
the request carries no agent_token at all, instead of only
|
|
337
|
+
enforcing validation once some earlier GET happened to supply
|
|
338
|
+
one.
|
|
339
|
+
"""
|
|
334
340
|
cmd_result = base.SyncCommandResult('do_things',
|
|
335
341
|
{'key': 'value'},
|
|
336
342
|
True,
|
|
337
343
|
{'test': 'result'})
|
|
338
|
-
cmd_result.serialize()
|
|
339
344
|
self.mock_agent.get_command_result.return_value = cmd_result
|
|
340
|
-
agent_token = str('0123456789' * 10)
|
|
341
345
|
self.mock_agent.validate_agent_token.return_value = False
|
|
342
346
|
|
|
343
|
-
# Backwards compatible operation check.
|
|
344
347
|
response = self.get_json(
|
|
345
|
-
'/commands/abc123')
|
|
346
|
-
self.assertEqual(200, response.status_code)
|
|
347
|
-
self.assertFalse(self.app.security_get_token_support)
|
|
348
|
-
self.assertEqual(1, self.mock_agent.get_command_result.call_count)
|
|
349
|
-
self.mock_agent.reset_mock()
|
|
348
|
+
'/commands/abc123', expect_errors=True)
|
|
350
349
|
|
|
351
|
-
# Check with a newer ironic sending an agent_token upon the command.
|
|
352
|
-
# For context, in this case the token is wrong intentionally.
|
|
353
|
-
# It doesn't have to be right, but what we're testing is the
|
|
354
|
-
# submission of any value triggers the lockout
|
|
355
|
-
response = self.get_json(
|
|
356
|
-
'/commands/abc123?agent_token=%s' % agent_token,
|
|
357
|
-
expect_errors=True)
|
|
358
|
-
self.assertTrue(self.app.security_get_token_support)
|
|
359
350
|
self.assertEqual(401, response.status_code)
|
|
360
351
|
self.assertEqual(1, self.mock_agent.validate_agent_token.call_count)
|
|
361
352
|
self.assertEqual(0, self.mock_agent.get_command_result.call_count)
|
|
362
353
|
|
|
363
|
-
|
|
364
|
-
#
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
self.
|
|
354
|
+
def test_list_commands_requires_token_without_one(self):
|
|
355
|
+
"""Tests LP#2160196: GET must not skip validation without a token."""
|
|
356
|
+
self.mock_agent.validate_agent_token.return_value = False
|
|
357
|
+
|
|
358
|
+
response = self.get_json('/commands', expect_errors=True)
|
|
359
|
+
|
|
368
360
|
self.assertEqual(401, response.status_code)
|
|
369
|
-
self.assertEqual(
|
|
370
|
-
|
|
371
|
-
self.assertEqual(2, self.mock_agent.validate_agent_token.call_count)
|
|
361
|
+
self.assertEqual(1, self.mock_agent.validate_agent_token.call_count)
|
|
362
|
+
self.assertEqual(0, self.mock_agent.list_command_results.call_count)
|
|
372
363
|
|
|
373
364
|
def test_execute_agent_command_with_token(self):
|
|
374
365
|
agent_token = str('0123456789' * 10)
|
|
@@ -245,11 +245,13 @@ class MatchRootDeviceTestCase(base.IronicAgentTest):
|
|
|
245
245
|
super(MatchRootDeviceTestCase, self).setUp()
|
|
246
246
|
self.devices = [
|
|
247
247
|
{'name': '/dev/sda', 'size': 64424509440, 'model': 'ok model',
|
|
248
|
-
'serial': 'fakeserial'},
|
|
248
|
+
'serial': 'fakeserial', 'wwn': 'wwn_1'},
|
|
249
249
|
{'name': '/dev/sdb', 'size': 128849018880, 'model': 'big model',
|
|
250
|
-
'serial': 'veryfakeserial', '
|
|
250
|
+
'serial': ['veryfakeserial', 'alsoveryfakeserial'],
|
|
251
|
+
'rotational': 'yes', 'wwn': ['wwn_2', 'wwn_2_ext']},
|
|
251
252
|
{'name': '/dev/sdc', 'size': 10737418240, 'model': 'small model',
|
|
252
|
-
'serial': 'veryveryfakeserial', 'rotational': False
|
|
253
|
+
'serial': 'veryveryfakeserial', 'rotational': False,
|
|
254
|
+
'wwn': 'wwn_3'},
|
|
253
255
|
]
|
|
254
256
|
|
|
255
257
|
def test_match_root_device_hints_one_hint(self):
|
|
@@ -292,6 +294,12 @@ class MatchRootDeviceTestCase(base.IronicAgentTest):
|
|
|
292
294
|
self.devices, root_device_hints)
|
|
293
295
|
self.assertEqual('/dev/sdc', dev['name'])
|
|
294
296
|
|
|
297
|
+
def test_match_root_device_hints_list_of_wwns(self):
|
|
298
|
+
root_device_hints = {'wwn': 'wwn_2_ext'}
|
|
299
|
+
dev = device_hints.match_root_device_hints(
|
|
300
|
+
self.devices, root_device_hints)
|
|
301
|
+
self.assertEqual('/dev/sdb', dev['name'])
|
|
302
|
+
|
|
295
303
|
def test_match_root_device_hints_no_operators(self):
|
|
296
304
|
root_device_hints = {'size': '120', 'model': 'big model',
|
|
297
305
|
'serial': 'veryfakeserial'}
|
|
@@ -328,3 +336,27 @@ class MatchRootDeviceTestCase(base.IronicAgentTest):
|
|
|
328
336
|
devs = list(device_hints.find_devices_by_hints(self.devices,
|
|
329
337
|
root_device_hints))
|
|
330
338
|
self.assertEqual([self.devices[0]], devs)
|
|
339
|
+
|
|
340
|
+
def test_find_devices_single_serial(self):
|
|
341
|
+
root_device_hints = {'serial': 's== fakeserial'}
|
|
342
|
+
devs = list(device_hints.find_devices_by_hints(self.devices,
|
|
343
|
+
root_device_hints))
|
|
344
|
+
self.assertEqual([self.devices[0]], devs)
|
|
345
|
+
|
|
346
|
+
def test_find_devices_multiple_serials(self):
|
|
347
|
+
root_device_hints = {'serial': 's== alsoveryfakeserial'}
|
|
348
|
+
devs = list(device_hints.find_devices_by_hints(self.devices,
|
|
349
|
+
root_device_hints))
|
|
350
|
+
self.assertEqual([self.devices[1]], devs)
|
|
351
|
+
|
|
352
|
+
def test_find_devices_single_wwn(self):
|
|
353
|
+
root_device_hints = {'wwn': 's== wwn_1'}
|
|
354
|
+
devs = list(device_hints.find_devices_by_hints(self.devices,
|
|
355
|
+
root_device_hints))
|
|
356
|
+
self.assertEqual([self.devices[0]], devs)
|
|
357
|
+
|
|
358
|
+
def test_find_devices_multiple_wwns(self):
|
|
359
|
+
root_device_hints = {'wwn': 's== wwn_2'}
|
|
360
|
+
devs = list(device_hints.find_devices_by_hints(self.devices,
|
|
361
|
+
root_device_hints))
|
|
362
|
+
self.assertEqual([self.devices[1]], devs)
|
|
@@ -297,6 +297,99 @@ Boot0009* Internal CD/DVD ROM Drive (UEFI) PciRoot(0x0)/Pci(0x11,0x0)/Sata(
|
|
|
297
297
|
'CDROM(1,0x265,0x2000)'),
|
|
298
298
|
result[13])
|
|
299
299
|
|
|
300
|
+
def test_get_boot_records_utf_8(self, mock_utils_efi_part,
|
|
301
|
+
mock_get_part_path,
|
|
302
|
+
mock_get_part_uuid, mock_execute,
|
|
303
|
+
mock_rescan):
|
|
304
|
+
efibootmgr_resp = """
|
|
305
|
+
BootCurrent: 0001
|
|
306
|
+
Timeout: 0 seconds
|
|
307
|
+
BootOrder: 0001,0000,001B,001C,001D,001E,001F,0020,0021,0022,0012,0011,0023,0024,0002
|
|
308
|
+
Boot0000* Red Hat Enterprise Linux HD(1,GPT,34178504-2340-4fe0-8001-264372cf9b2d,0x800,0x64000)/File(\\EFI\\redhat\\shimx64.efi)
|
|
309
|
+
Boot0001* Fedora HD(1,GPT,da6b4491-61f2-42b0-8ab1-7c4a87317c4e,0x800,0x64000)/File(\\EFI\\fedora\\shimx64.efi)
|
|
310
|
+
Boot0002* Linux-Firmware-Updater HD(1,GPT,da6b4491-61f2-42b0-8ab1-7c4a87317c4e,0x800,0x64000)/File(\\EFI\\fedora\\fwupdx64.efi)
|
|
311
|
+
Boot0003 ThinkShield secure wipe FvFile(3593a0d5-bd52-43a0-808e-cbff5ece2477)
|
|
312
|
+
Boot0004 LENOVO CLOUD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,ad38ccbbf7edf04d959cf42aa74d3650)/Uri(https://download.lenovo.com/pccbbs/cdeploy/efi/boot.efi)
|
|
313
|
+
Boot0005 IDER BOOT CDROM PciRoot(0x0)/Pci(0x14,0x0)/USB(11,1)
|
|
314
|
+
Boot0006 ATA HDD VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f6)
|
|
315
|
+
Boot0007* Hard drive C: VenHw(d6c0639f-c705-4eb9-aa4f-5802d8823de6)......................................................................................A.....................P.E.R.C. .H.7.3.0.P. .M.i.n.i.(.b.u.s. .1.8. .d.e.v. .0.0.)...
|
|
316
|
+
BootAAA8* IBA GE Slot 0100 v1588 BBS(128,IBA GE Slot 0100 v1588,0x0)........................B.............................................................A.....................I.B.A. .G.E. .S.l.o.t. .0.1.0.0. .v.1.5.8.8...
|
|
317
|
+
Boot0FF9* Virtual CD/DVD PciRoot(0x0)/Pci(0x14,0x0)/USB(13,0)/USB(3,0)/USB(1,0)
|
|
318
|
+
Boot123A* Integrated NIC 1 Port 1 Partition 1 VenHw(33391845-5f86-4e78-8fce-c4cff59f9bbb)
|
|
319
|
+
Boot000B* UEFI: PXE IPv4 Realtek PCIe 2.5GBE Family Controller PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC([REDACTED],0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
|
|
320
|
+
Boot0008* Generic USB Boot UsbClass(ffff,ffff,255,255)
|
|
321
|
+
Boot0009* Internal CD/DVD ROM Drive (UEFI) PciRoot(0x0)/Pci(0x11,0x0)/Sata(1,65535,0)/CDROM(1,0x265,0x2000)
|
|
322
|
+
""".encode('utf-8') # noqa This is a giant literal string for testing.
|
|
323
|
+
mock_execute.return_value = (efibootmgr_resp, '')
|
|
324
|
+
result = list(efi_utils.get_boot_records())
|
|
325
|
+
|
|
326
|
+
self.assertEqual(
|
|
327
|
+
('0000', 'Red Hat Enterprise Linux', 'HD',
|
|
328
|
+
'HD(1,GPT,34178504-2340-4fe0-8001-264372cf9b2d,0x800,0x64000)/'
|
|
329
|
+
'File(\\EFI\\redhat\\shimx64.efi)'),
|
|
330
|
+
result[0])
|
|
331
|
+
self.assertEqual(
|
|
332
|
+
('0001', 'Fedora', 'HD',
|
|
333
|
+
'HD(1,GPT,da6b4491-61f2-42b0-8ab1-7c4a87317c4e,0x800,0x64000)/'
|
|
334
|
+
'File(\\EFI\\fedora\\shimx64.efi)'),
|
|
335
|
+
result[1])
|
|
336
|
+
self.assertEqual(
|
|
337
|
+
('0002', 'Linux-Firmware-Updater', 'HD',
|
|
338
|
+
'HD(1,GPT,da6b4491-61f2-42b0-8ab1-7c4a87317c4e,0x800,0x64000)/'
|
|
339
|
+
'File(\\EFI\\fedora\\fwupdx64.efi)'),
|
|
340
|
+
result[2])
|
|
341
|
+
self.assertEqual(
|
|
342
|
+
('0003', 'ThinkShield secure wipe', 'FvFile',
|
|
343
|
+
'FvFile(3593a0d5-bd52-43a0-808e-cbff5ece2477)'),
|
|
344
|
+
result[3])
|
|
345
|
+
self.assertEqual(
|
|
346
|
+
('0004', 'LENOVO CLOUD', 'VenMsg',
|
|
347
|
+
'VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,'
|
|
348
|
+
'ad38ccbbf7edf04d959cf42aa74d3650)/'
|
|
349
|
+
'Uri(https://download.lenovo.com/pccbbs/cdeploy/efi/boot.efi)'),
|
|
350
|
+
result[4])
|
|
351
|
+
self.assertEqual(
|
|
352
|
+
('0005', 'IDER BOOT CDROM', 'PciRoot',
|
|
353
|
+
'PciRoot(0x0)/Pci(0x14,0x0)/USB(11,1)'),
|
|
354
|
+
result[5])
|
|
355
|
+
self.assertEqual(
|
|
356
|
+
('0006', 'ATA HDD', 'VenMsg',
|
|
357
|
+
'VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,'
|
|
358
|
+
'91af625956449f41a7b91f4f892ab0f6)'),
|
|
359
|
+
result[6])
|
|
360
|
+
self.assertEqual(
|
|
361
|
+
('0007', 'Hard drive C:', 'VenHw',
|
|
362
|
+
mock.ANY),
|
|
363
|
+
result[7])
|
|
364
|
+
self.assertEqual(
|
|
365
|
+
('AAA8', 'IBA GE Slot 0100 v1588', 'BBS',
|
|
366
|
+
mock.ANY),
|
|
367
|
+
result[8])
|
|
368
|
+
self.assertEqual(
|
|
369
|
+
('0FF9', 'Virtual CD/DVD', 'PciRoot',
|
|
370
|
+
'PciRoot(0x0)/Pci(0x14,0x0)/USB(13,0)/USB(3,0)/USB(1,0)'),
|
|
371
|
+
result[9])
|
|
372
|
+
self.assertEqual(
|
|
373
|
+
('123A', 'Integrated NIC 1 Port 1 Partition 1', 'VenHw',
|
|
374
|
+
'VenHw(33391845-5f86-4e78-8fce-c4cff59f9bbb)'),
|
|
375
|
+
result[10])
|
|
376
|
+
self.assertEqual(
|
|
377
|
+
('000B',
|
|
378
|
+
'UEFI: PXE IPv4 Realtek PCIe 2.5GBE Family Controller',
|
|
379
|
+
'PciRoot',
|
|
380
|
+
'PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC([REDACTED],0)/'
|
|
381
|
+
'IPv4(0.0.0.00.0.0.0,0,0)..BO'),
|
|
382
|
+
result[11])
|
|
383
|
+
self.assertEqual(
|
|
384
|
+
('0008', 'Generic USB Boot', 'UsbClass',
|
|
385
|
+
'UsbClass(ffff,ffff,255,255)'),
|
|
386
|
+
result[12])
|
|
387
|
+
self.assertEqual(
|
|
388
|
+
('0009', 'Internal CD/DVD ROM Drive (UEFI)', 'PciRoot',
|
|
389
|
+
'PciRoot(0x0)/Pci(0x11,0x0)/Sata(1,65535,0)/'
|
|
390
|
+
'CDROM(1,0x265,0x2000)'),
|
|
391
|
+
result[13])
|
|
392
|
+
|
|
300
393
|
def test_clean_boot_records(self, mock_utils_efi_part,
|
|
301
394
|
mock_get_part_path,
|
|
302
395
|
mock_get_part_uuid, mock_execute,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: ironic-python-agent
|
|
3
|
-
Version: 10.2.
|
|
3
|
+
Version: 10.2.3
|
|
4
4
|
Summary: Ironic Python Agent Ramdisk
|
|
5
5
|
Home-page: https://docs.openstack.org/ironic-python-agent/
|
|
6
6
|
Author: OpenStack
|
|
@@ -22,31 +22,42 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
22
22
|
Requires-Python: >=3.9
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
License-File: AUTHORS
|
|
25
|
-
Requires-Dist: pbr
|
|
26
|
-
Requires-Dist: eventlet
|
|
27
|
-
Requires-Dist: oslo.config
|
|
28
|
-
Requires-Dist: oslo.concurrency
|
|
29
|
-
Requires-Dist: oslo.log
|
|
30
|
-
Requires-Dist: oslo.service
|
|
31
|
-
Requires-Dist: oslo.utils
|
|
32
|
-
Requires-Dist: Pint
|
|
33
|
-
Requires-Dist: psutil
|
|
34
|
-
Requires-Dist: pyudev
|
|
35
|
-
Requires-Dist: requests
|
|
36
|
-
Requires-Dist: stevedore
|
|
37
|
-
Requires-Dist: tenacity
|
|
38
|
-
Requires-Dist: Werkzeug
|
|
39
|
-
Requires-Dist: cryptography
|
|
40
|
-
Requires-Dist: tooz
|
|
41
|
-
Requires-Dist: zeroconf
|
|
42
|
-
Provides-Extra:
|
|
43
|
-
Requires-Dist: kazoo
|
|
25
|
+
Requires-Dist: pbr>=6.0.0
|
|
26
|
+
Requires-Dist: eventlet>=0.18.2
|
|
27
|
+
Requires-Dist: oslo.config>=5.2.0
|
|
28
|
+
Requires-Dist: oslo.concurrency>=3.26.0
|
|
29
|
+
Requires-Dist: oslo.log>=4.6.1
|
|
30
|
+
Requires-Dist: oslo.service>=1.24.0
|
|
31
|
+
Requires-Dist: oslo.utils>=8.0.0
|
|
32
|
+
Requires-Dist: Pint>=0.5
|
|
33
|
+
Requires-Dist: psutil>=3.2.2
|
|
34
|
+
Requires-Dist: pyudev>=0.18
|
|
35
|
+
Requires-Dist: requests>=2.14.2
|
|
36
|
+
Requires-Dist: stevedore>=1.20.0
|
|
37
|
+
Requires-Dist: tenacity>=6.2.0
|
|
38
|
+
Requires-Dist: Werkzeug>=2.0.0
|
|
39
|
+
Requires-Dist: cryptography>=2.3
|
|
40
|
+
Requires-Dist: tooz>=2.7.2
|
|
41
|
+
Requires-Dist: zeroconf>=0.24.0
|
|
42
|
+
Provides-Extra: burnin-network-kazoo
|
|
43
|
+
Requires-Dist: kazoo>=2.8.0; extra == "burnin-network-kazoo"
|
|
44
44
|
Provides-Extra: test
|
|
45
|
-
Requires-Dist: coverage
|
|
46
|
-
Requires-Dist: testtools
|
|
47
|
-
Requires-Dist: oslotest
|
|
48
|
-
Requires-Dist: stestr
|
|
49
|
-
Requires-Dist: bandit
|
|
45
|
+
Requires-Dist: coverage>=4.0; extra == "test"
|
|
46
|
+
Requires-Dist: testtools>=2.2.0; extra == "test"
|
|
47
|
+
Requires-Dist: oslotest>=3.2.0; extra == "test"
|
|
48
|
+
Requires-Dist: stestr>=1.0.0; extra == "test"
|
|
49
|
+
Requires-Dist: bandit<2.0.0,>=1.1.0; extra == "test"
|
|
50
|
+
Dynamic: author
|
|
51
|
+
Dynamic: author-email
|
|
52
|
+
Dynamic: classifier
|
|
53
|
+
Dynamic: description
|
|
54
|
+
Dynamic: home-page
|
|
55
|
+
Dynamic: license
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
Dynamic: provides-extra
|
|
58
|
+
Dynamic: requires-dist
|
|
59
|
+
Dynamic: requires-python
|
|
60
|
+
Dynamic: summary
|
|
50
61
|
|
|
51
62
|
===================
|
|
52
63
|
Ironic Python Agent
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
ironic_python_agent/__init__.py,sha256=mc-uYTe1_UuODFQuFUhLM6qHDRmFQwbjh06NzGFIJWg,903
|
|
2
|
-
ironic_python_agent/agent.py,sha256=
|
|
2
|
+
ironic_python_agent/agent.py,sha256=vdHosvoBoRNLIn4kgQ155veur6WbryTpPSzavVdc0cY,26304
|
|
3
3
|
ironic_python_agent/burnin.py,sha256=WyeUB1ViD2vPMstHD1AFrEfE3WTtSaHg7LAVGA9Dp84,19159
|
|
4
|
-
ironic_python_agent/config.py,sha256=
|
|
5
|
-
ironic_python_agent/device_hints.py,sha256=
|
|
4
|
+
ironic_python_agent/config.py,sha256=heeRT3l-NStlrQAW_StAdUFOISjqzhtFUWcRAdfrJe4,25415
|
|
5
|
+
ironic_python_agent/device_hints.py,sha256=9rkfGreJCyLIiIThMvppeu6OXCUKrPGVeNnAhe7k-Jw,15724
|
|
6
6
|
ironic_python_agent/disk_partitioner.py,sha256=LbT6Xnu5cpAQqsDeB6MwN-BP5OVZfc9x8XcmGFwz-og,4888
|
|
7
7
|
ironic_python_agent/disk_utils.py,sha256=wuR6TOUp-Pb3Jy1MrkiCXPOGOyzl_EvLqE3_cUB98Xc,32202
|
|
8
8
|
ironic_python_agent/dmi_inspector.py,sha256=wyTdUFuwx7tKUuLR64OfF7c3QdQ8ILb6lrS4d3urf9k,4090
|
|
9
|
-
ironic_python_agent/efi_utils.py,sha256=
|
|
9
|
+
ironic_python_agent/efi_utils.py,sha256=71DBl1ruaF5Hzw5B1VAweaGquG_qCm_T_5FsN8cA3ZQ,17047
|
|
10
10
|
ironic_python_agent/encoding.py,sha256=ifMKd3dW_hRCHz-JCcovdXnzwu4XkLKtknriaUZeijo,2345
|
|
11
11
|
ironic_python_agent/errors.py,sha256=j2ZZjQfqlqAU73bpNJTyuQpGlLvyRXvnQcLcdDm6h-U,13547
|
|
12
|
-
ironic_python_agent/hardware.py,sha256=
|
|
12
|
+
ironic_python_agent/hardware.py,sha256=Dse3SQWj2sgefyDzT2TSR99j8j3416IVxScDDuzZdzE,161264
|
|
13
13
|
ironic_python_agent/inject_files.py,sha256=iEt_wdXHRPioLgUpCm1VABXOodefx0vJMy3hR6e_4bo,9412
|
|
14
14
|
ironic_python_agent/inspect.py,sha256=3vl67DSIPU82qHilapbYdyiVwQs9CDU2XQLLdWRz2t4,5113
|
|
15
15
|
ironic_python_agent/inspector.py,sha256=AQ0qkdSFUUREMExTjR8sUFAUqcJbt-K32sY5GxAwYAQ,16195
|
|
@@ -24,7 +24,7 @@ ironic_python_agent/tls_utils.py,sha256=K0bjcc08aFJZwlJfXZ6d1Qwrom_OplaMmjcQHt5x
|
|
|
24
24
|
ironic_python_agent/utils.py,sha256=ydH7EySJFFgTs4mwIPRsUXnuUw-naOD2exfzJaiIQXo,43151
|
|
25
25
|
ironic_python_agent/version.py,sha256=7EinnHTBHWpbgJF5yaobeBEKiwTq1nfXxeDMFIMz_c4,754
|
|
26
26
|
ironic_python_agent/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
-
ironic_python_agent/api/app.py,sha256=
|
|
27
|
+
ironic_python_agent/api/app.py,sha256=1QNd7IP4jGkJjhQ7LSEHBtZ09ktY4s8GySC9nYlVQqs,8965
|
|
28
28
|
ironic_python_agent/cmd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
ironic_python_agent/cmd/agent.py,sha256=5qyFN8uSu9S2bDoAeCYxglrfUwCnNbTTwY5Z517d8Ms,1685
|
|
30
30
|
ironic_python_agent/cmd/inspect.py,sha256=4CbaZFsCyXp5ym47rTZz0V-dMc0ZljH-toz7D-HVpc0,914
|
|
@@ -33,12 +33,12 @@ ironic_python_agent/extensions/base.py,sha256=KnyTnsqvcGcWyyobYvMwIBJkGjNPLPXH8m
|
|
|
33
33
|
ironic_python_agent/extensions/clean.py,sha256=6u6EJw1GJcAAbuyuS7XBea4VtN3wO9LP0Xf82rsoIAg,4174
|
|
34
34
|
ironic_python_agent/extensions/deploy.py,sha256=8jDKfOKqvGU-HEAH4kzVQrT-o3ciwQyAu6dTVUuXmTA,4238
|
|
35
35
|
ironic_python_agent/extensions/flow.py,sha256=SsKjl_eLexp1U30PyhotgMEKMKrEsAYtdJJQIzOYJJw,1828
|
|
36
|
-
ironic_python_agent/extensions/image.py,sha256=
|
|
36
|
+
ironic_python_agent/extensions/image.py,sha256=GeTGbv4907jNXssfDrJH_ch9pyUprcfDSRJzyZN8fj4,33602
|
|
37
37
|
ironic_python_agent/extensions/log.py,sha256=7yWvwFJGu477VhTwWY1ww03INqeXCeZ150Nb1LGsnjY,1295
|
|
38
38
|
ironic_python_agent/extensions/poll.py,sha256=N6Cv7ReFfrCiEPjCtLNjzdHqzLF2U2TftoIvsWfRkYs,1700
|
|
39
39
|
ironic_python_agent/extensions/rescue.py,sha256=VjLH1b1Z30P1F1sq30DQPm2xND2Uc486MOMaGrzNg1s,2865
|
|
40
40
|
ironic_python_agent/extensions/service.py,sha256=V9h0uZ2M0Xx6G3y4ZCgWfNpEcUayq7WtKBqkd1Y1pZ4,4184
|
|
41
|
-
ironic_python_agent/extensions/standby.py,sha256=
|
|
41
|
+
ironic_python_agent/extensions/standby.py,sha256=COzQj4YkBti-JrEDN6Xp8w48NCF8Wj2LknMWjLRqEfM,60889
|
|
42
42
|
ironic_python_agent/extensions/system.py,sha256=Bu-B8e_SLTCrLz6u3sWb8hlthvG1ZNp2G4HtM_o2qo4,1041
|
|
43
43
|
ironic_python_agent/hardware_managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
ironic_python_agent/hardware_managers/cna.py,sha256=uQoNrnGh8vgpD_jx4NpgU_VIGBqH7nIFNFaBrUA-SCU,3333
|
|
@@ -51,20 +51,20 @@ ironic_python_agent/metrics_lib/metrics_statsd.py,sha256=sWHsvz_YyfEOb20S7ToXsj3
|
|
|
51
51
|
ironic_python_agent/metrics_lib/metrics_utils.py,sha256=p9V_AwK1-0AwGm9M8rx9xj75TcaoujYhcDoQ9uAwwe4,4046
|
|
52
52
|
ironic_python_agent/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
ironic_python_agent/tests/functional/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
|
-
ironic_python_agent/tests/functional/base.py,sha256=
|
|
55
|
-
ironic_python_agent/tests/functional/test_commands.py,sha256=
|
|
54
|
+
ironic_python_agent/tests/functional/base.py,sha256=myHkHeseSuMVI2tL09DlsKESLmkHCwDx4yn3F3e-5cI,4048
|
|
55
|
+
ironic_python_agent/tests/functional/test_commands.py,sha256=R2TsMb3OjoRPlMALilSJZH5k62p2Mk0kcHiII68LdLg,3932
|
|
56
56
|
ironic_python_agent/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
ironic_python_agent/tests/unit/base.py,sha256=RDdzfYYqP5MJQw7xl_tzevGgpf9oFdX1-RXNtv5627k,3303
|
|
58
58
|
ironic_python_agent/tests/unit/dmi_inspector_data.py,sha256=mET88ujAb9LIVSMo4tD3cPSefyRtKqY61YquRIga66E,22841
|
|
59
|
-
ironic_python_agent/tests/unit/test_agent.py,sha256=
|
|
60
|
-
ironic_python_agent/tests/unit/test_api.py,sha256=
|
|
59
|
+
ironic_python_agent/tests/unit/test_agent.py,sha256=2AxRm8N1EOajMROJDu8CUl1VioJbDpfQvtTJiBc0gRE,67179
|
|
60
|
+
ironic_python_agent/tests/unit/test_api.py,sha256=y_g6aWqqwJYW-_KYkvqVd5VLbgwTL0z9gprsaxwae-0,17265
|
|
61
61
|
ironic_python_agent/tests/unit/test_base.py,sha256=cvZNtThH3IBIL2Wwuw6a3HIyyndc1YdO8YWrFaPyV18,2526
|
|
62
62
|
ironic_python_agent/tests/unit/test_burnin.py,sha256=dhfgBpZEJJdbcplSKLIeE3iyV_O7unsoUS3MXI0og-4,22412
|
|
63
|
-
ironic_python_agent/tests/unit/test_device_hints.py,sha256=
|
|
63
|
+
ironic_python_agent/tests/unit/test_device_hints.py,sha256=jOjEyLfFemJDFyIEyHDsgMRX7mG9gdhfVwCgvdx40zg,16234
|
|
64
64
|
ironic_python_agent/tests/unit/test_disk_partitioner.py,sha256=oAu9MTr5e_LlI4U2242-iJEkKjaCM1rsRjTp0i9p6Ow,9396
|
|
65
65
|
ironic_python_agent/tests/unit/test_disk_utils.py,sha256=Dh_3uOfE0qBb0CQoo9Du0qRDoAGS2Hl3xufdMbjni9s,49011
|
|
66
66
|
ironic_python_agent/tests/unit/test_dmi_inspector.py,sha256=vbobkICrQ97e5gEARikcMOHqPoVu9Cdl8B-ytNUrYZI,4833
|
|
67
|
-
ironic_python_agent/tests/unit/test_efi_utils.py,sha256=
|
|
67
|
+
ironic_python_agent/tests/unit/test_efi_utils.py,sha256=1B962Asc-FCHNPLSbI-TZWyKvwCql_xMYWitGI1khyM,38287
|
|
68
68
|
ironic_python_agent/tests/unit/test_encoding.py,sha256=7qDOTlT4LsYVRnyluvdulwifl0EgykZOzLoLPx5y9ek,2408
|
|
69
69
|
ironic_python_agent/tests/unit/test_errors.py,sha256=bm0kDx7BshIdeuQK3Hm-2sAHUGkPehCELKZEsDRQv5c,6022
|
|
70
70
|
ironic_python_agent/tests/unit/test_hardware.py,sha256=6TNQftRF5b4VWtUFkoImsRfBtoOgtISkAOplbPoUH_g,333552
|
|
@@ -86,7 +86,7 @@ ironic_python_agent/tests/unit/extensions/test_base.py,sha256=87KYTvT8fKcUxnDyc-
|
|
|
86
86
|
ironic_python_agent/tests/unit/extensions/test_clean.py,sha256=-Xe5OZtRBV5kHGQ49Ph2SQJluwbxExJ9JovKSUlHRao,12152
|
|
87
87
|
ironic_python_agent/tests/unit/extensions/test_deploy.py,sha256=mW_zS-n0aapn0sQn7gJdp5AJ7Dze85pDsebuBkyo9tw,12164
|
|
88
88
|
ironic_python_agent/tests/unit/extensions/test_flow.py,sha256=_Hk51jkmK2_Co2dGiGan4y4ULox_93qpRd2LFogB2Gg,4358
|
|
89
|
-
ironic_python_agent/tests/unit/extensions/test_image.py,sha256=
|
|
89
|
+
ironic_python_agent/tests/unit/extensions/test_image.py,sha256=IuuiReRgQpPlHfuOUOETslO4h6fe5de304DbmRAHVXY,112531
|
|
90
90
|
ironic_python_agent/tests/unit/extensions/test_log.py,sha256=bufFrUIs8lkpcATCg0s_yXuQxZBpattJChGexBjjrAI,1398
|
|
91
91
|
ironic_python_agent/tests/unit/extensions/test_poll.py,sha256=wNmPvDKSLCVQ6pPZ6B7kqjkrjYTMbpi0Z0AXXKUjtlQ,2776
|
|
92
92
|
ironic_python_agent/tests/unit/extensions/test_rescue.py,sha256=Tk5q_Ka9dmnXpRA8yIakYNjk7C63t17bVcvrPPELF0Y,5264
|
|
@@ -102,11 +102,11 @@ ironic_python_agent/tests/unit/metrics_lib/test_metrics_collector.py,sha256=0Q2g
|
|
|
102
102
|
ironic_python_agent/tests/unit/metrics_lib/test_metrics_statsd.py,sha256=REiOILpW3Xx29y20O2e89kiPRw3gGbFvHJ3w1VSEixo,3924
|
|
103
103
|
ironic_python_agent/tests/unit/metrics_lib/test_metrics_utils.py,sha256=uXfuzTZqkete3NGd9_CpZdv2tRt84xcaK_rd5zFlbCs,4548
|
|
104
104
|
ironic_python_agent/tests/unit/samples/hardware_samples.py,sha256=MnnyiRY6ozDZvdFIU_3jGCYRASggJZcgiJynucmTik8,59286
|
|
105
|
-
ironic_python_agent-10.2.
|
|
106
|
-
ironic_python_agent-10.2.
|
|
107
|
-
ironic_python_agent-10.2.
|
|
108
|
-
ironic_python_agent-10.2.
|
|
109
|
-
ironic_python_agent-10.2.
|
|
110
|
-
ironic_python_agent-10.2.
|
|
111
|
-
ironic_python_agent-10.2.
|
|
112
|
-
ironic_python_agent-10.2.
|
|
105
|
+
ironic_python_agent-10.2.3.dist-info/licenses/AUTHORS,sha256=YgVFdxaeqfZMM17QIqkquLm4Ql3AFNk596ysgtQqiWM,8667
|
|
106
|
+
ironic_python_agent-10.2.3.dist-info/licenses/LICENSE,sha256=eYI6Jl-hPXZGT4fIcb4joP6fMoYRKf_oONHtLMiPfkQ,561
|
|
107
|
+
ironic_python_agent-10.2.3.dist-info/METADATA,sha256=IgITGerSyMQLXdcrhoXFu8ZiQOJCKDw66qZP1Sq_vuw,4062
|
|
108
|
+
ironic_python_agent-10.2.3.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
109
|
+
ironic_python_agent-10.2.3.dist-info/entry_points.txt,sha256=-UCKTguVlj1FATKoa0LN3Cz48L5s0CkUt_XGOl6-IMQ,1674
|
|
110
|
+
ironic_python_agent-10.2.3.dist-info/pbr.json,sha256=oC6FvAkLN5Kd2Z9KoV4mOMby1V4-H5SbKC3CQhlrskw,47
|
|
111
|
+
ironic_python_agent-10.2.3.dist-info/top_level.txt,sha256=4UvmXY2TkynkLeFUThJX8rC4AWARHl7GtqmajaXD-tw,20
|
|
112
|
+
ironic_python_agent-10.2.3.dist-info/RECORD,,
|
{ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info/licenses}/AUTHORS
RENAMED
|
@@ -117,6 +117,7 @@ Mike Heald <mike.heald@hp.com>
|
|
|
117
117
|
Mike Turek <mjturek@linux.vnet.ibm.com>
|
|
118
118
|
Miles Gould <mgould@redhat.com>
|
|
119
119
|
Mohammed Naser <mnaser@vexxhost.com>
|
|
120
|
+
Morten Stephansen <morten.kaastrup.stephansen@cern.ch>
|
|
120
121
|
Moshe Levi <moshele@mellanox.com>
|
|
121
122
|
Nam Nguyen Hoai <namnh@vn.fujitsu.com>
|
|
122
123
|
Naohiro Tamura <naohirot@jp.fujitsu.com>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "03bdd46d", "is_release": true}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "1492c705", "is_release": true}
|
{ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{ironic_python_agent-10.2.2.dist-info → ironic_python_agent-10.2.3.dist-info/licenses}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|