summaryrefslogtreecommitdiff
path: root/ironic_python_agent/hardware.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2020-11-20 17:07:00 +0100
committerDmitry Tantsur <dtantsur@protonmail.com>2020-11-24 07:58:23 +0000
commit4fd3f25cd64e151fd5a363ab5b217b5dcdd406a0 (patch)
tree041cf4a9c18c74662d4900568d7dfeac705ffdad /ironic_python_agent/hardware.py
parent31e9d0db8c1ea3f8f7dfe1328f7ab0b19325a363 (diff)
downloadironic-python-agent-6.4.2.tar.gz
Make mdadm a soft requirement6.4.2
No point in requiring it for deployments that don't use software RAID. Change-Id: I8b40f02cc81d3154f98fa3f2cbb4d3c7319291b8 (cherry picked from commit ab8dee03867a5868bc1ec99f45481313bab88660)
Diffstat (limited to 'ironic_python_agent/hardware.py')
-rw-r--r--ironic_python_agent/hardware.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py
index c52cbb45..5f172260 100644
--- a/ironic_python_agent/hardware.py
+++ b/ironic_python_agent/hardware.py
@@ -282,6 +282,10 @@ def is_md_device(raid_device):
utils.execute('mdadm', '--detail', raid_device)
LOG.debug("%s is an md device", raid_device)
return True
+ except FileNotFoundError:
+ LOG.debug('mdadm has not been found, assuming %s is not an md device',
+ raid_device)
+ return False
except processutils.ProcessExecutionError:
LOG.debug("%s is not an md device", raid_device)
return False
@@ -333,6 +337,9 @@ def _md_scan_and_assemble():
"""
try:
utils.execute('mdadm', '--assemble', '--scan', '--verbose')
+ except FileNotFoundError:
+ LOG.warning('mdadm has not been found, RAID devices will not be '
+ 'supported')
except processutils.ProcessExecutionError:
LOG.info('No new RAID devices assembled during start-up')