diff options
author | Riccardo Pittau <elfosardo@gmail.com> | 2020-04-24 12:10:22 +0200 |
---|---|---|
committer | Riccardo Pittau <elfosardo@gmail.com> | 2020-05-25 08:11:28 +0000 |
commit | 557d5603a29d0074402ec4d6f35927f6e79f2cf3 (patch) | |
tree | 18c214b65f5c511d3145a7d5e72a2d4982bc39fd /ironic_python_agent/hardware.py | |
parent | bfa184e88d18da35ee3e16bf2b8825d2bcf88e0d (diff) | |
download | ironic-python-agent-557d5603a29d0074402ec4d6f35927f6e79f2cf3.tar.gz |
Split and move logic for partition tables
Move and split the logic to create the partition tables when
applying raid configuration.
Change-Id: Ic76dd2067ace02dd02351caca0c7f9b05571e510
Diffstat (limited to 'ironic_python_agent/hardware.py')
-rw-r--r-- | ironic_python_agent/hardware.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py index ea54300a..a5b31c73 100644 --- a/ironic_python_agent/hardware.py +++ b/ironic_python_agent/hardware.py @@ -1652,21 +1652,8 @@ class GenericHardwareManager(HardwareManager): partition_table_type = utils.get_partition_table_type_from_specs(node) target_boot_mode = utils.get_node_boot_mode(node) - parted_start_dict = {} - # Create a partition table on each disk. - for dev_name in block_devices: - LOG.info("Creating partition table on {}".format( - dev_name)) - try: - utils.execute('parted', dev_name, '-s', '--', - 'mklabel', partition_table_type) - except processutils.ProcessExecutionError as e: - msg = "Failed to create partition table on {}: {}".format( - dev_name, e) - raise errors.SoftwareRAIDError(msg) - - parted_start_dict[dev_name] = raid_utils.calculate_raid_start( - target_boot_mode, partition_table_type, dev_name) + parted_start_dict = raid_utils.create_raid_partition_tables( + block_devices, partition_table_type, target_boot_mode) LOG.debug("First available sectors per devices %s", parted_start_dict) |