summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2020-11-20 17:07:00 +0100
committerDmitry Tantsur <dtantsur@protonmail.com>2020-11-20 17:07:00 +0100
commitab8dee03867a5868bc1ec99f45481313bab88660 (patch)
tree6e3f8789e62031dcc0486f034670218879886349
parent37dc11fcc1056dd367f9ae36897e01e37f97fccf (diff)
downloadironic-python-agent-ab8dee03867a5868bc1ec99f45481313bab88660.tar.gz
Make mdadm a soft requirement
No point in requiring it for deployments that don't use software RAID. Change-Id: I8b40f02cc81d3154f98fa3f2cbb4d3c7319291b8
-rw-r--r--ironic_python_agent/hardware.py7
-rw-r--r--releasenotes/notes/mdadm-d5b8c186182620b1.yaml5
2 files changed, 12 insertions, 0 deletions
diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py
index e142fdb9..53b7f705 100644
--- a/ironic_python_agent/hardware.py
+++ b/ironic_python_agent/hardware.py
@@ -305,6 +305,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
@@ -356,6 +360,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')
diff --git a/releasenotes/notes/mdadm-d5b8c186182620b1.yaml b/releasenotes/notes/mdadm-d5b8c186182620b1.yaml
new file mode 100644
index 00000000..18d60523
--- /dev/null
+++ b/releasenotes/notes/mdadm-d5b8c186182620b1.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - |
+ The ``mdadm`` utility is no longer a hard requirement. It's still required
+ if software RAID is used (even when not managed by ironic).