summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamakrishnan G <rameshg87@gmail.com>2015-03-18 05:24:24 +0000
committerRamakrishnan G <rameshg87@gmail.com>2015-03-18 05:26:52 +0000
commitcb2e58207203b210d91dacca3c40d91ed1c45a24 (patch)
tree1928e3079723dd646d5c69738566f8ffab6434fe
parent0f1bb1bfb6b34e65e587449c73753df74281cd7a (diff)
downloadironic-cb2e58207203b210d91dacca3c40d91ed1c45a24.tar.gz
Address nits in uefi agent iscsi deploy commit
This commit address the last comments given in the commit Ic7337fa1b0a5aefd3137b754acc88c547fc7e9e2 It fixes a few docstrings and changes lengthy variable names. Change-Id: Idb33ca2587fa814ed8a12e3acad0dcaafb83e9e7
-rw-r--r--ironic/drivers/modules/agent_base_vendor.py2
-rw-r--r--ironic/drivers/modules/deploy_utils.py19
-rw-r--r--ironic/drivers/modules/ilo/deploy.py13
-rw-r--r--ironic/drivers/modules/iscsi_deploy.py27
-rw-r--r--ironic/drivers/modules/pxe.py17
5 files changed, 47 insertions, 31 deletions
diff --git a/ironic/drivers/modules/agent_base_vendor.py b/ironic/drivers/modules/agent_base_vendor.py
index 542a1a459..d6ef9c27f 100644
--- a/ironic/drivers/modules/agent_base_vendor.py
+++ b/ironic/drivers/modules/agent_base_vendor.py
@@ -358,7 +358,7 @@ class BaseAgentVendor(base.VendorInterface):
:param root_uuid: The UUID of the root partition. This is used
for identifying the partition which contains the image deployed.
:param efi_system_part_uuid: The UUID of the efi system partition.
- This is used only in uef boot mode.
+ This is used only in uefi boot mode.
:raises: InstanceDeployFailure if bootloader installation failed or
on encountering error while setting the boot device on the node.
"""
diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py
index 1c43aeffd..8365ecebf 100644
--- a/ironic/drivers/modules/deploy_utils.py
+++ b/ironic/drivers/modules/deploy_utils.py
@@ -557,8 +557,12 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format,
or configdrive HTTP URL.
:param boot_option: Can be "local" or "netboot". "netboot" by default.
:param boot_mode: Can be "bios" or "uefi". "bios" by default.
- :returns: a dictionary containing the UUID of root partition and efi system
- partition (if boot mode is uefi).
+ :returns: a dictionary containing the following keys:
+ 'root uuid': UUID of root partition
+ 'efi system partition uuid': UUID of the uefi system partition
+ (if boot mode is uefi).
+ NOTE: If key exists but value is None, it means partition doesn't
+ exist.
"""
# the only way for preserve_ephemeral to be set to true is if we are
# rebuilding an instance with --preserve_ephemeral.
@@ -667,8 +671,12 @@ def deploy_partition_image(address, port, iqn, lun, image_path,
or configdrive HTTP URL.
:param boot_option: Can be "local" or "netboot". "netboot" by default.
:param boot_mode: Can be "bios" or "uefi". "bios" by default.
- :returns: a dictionary containing the UUID of root partition and efi system
- partition (if boot mode is uefi).
+ :returns: a dictionary containing the following keys:
+ 'root uuid': UUID of root partition
+ 'efi system partition uuid': UUID of the uefi system partition
+ (if boot mode is uefi).
+ NOTE: If key exists but value is None, it means partition doesn't
+ exist.
"""
with _iscsi_setup_and_handle_errors(address, port, iqn,
lun, image_path) as dev:
@@ -696,7 +704,8 @@ def deploy_disk_image(address, port, iqn, lun,
:param image_path: Path for the instance's disk image.
:param node_uuid: node's uuid. Used for logging. Currently not in use
by this function but could be used in the future.
- :returns: a dictionary containing the disk identifier for the disk.
+ :returns: a dictionary containing the key 'disk identifier' to identify
+ the disk which was used for deployment.
"""
with _iscsi_setup_and_handle_errors(address, port, iqn,
lun, image_path) as dev:
diff --git a/ironic/drivers/modules/ilo/deploy.py b/ironic/drivers/modules/ilo/deploy.py
index 5e1b223bc..e30257f29 100644
--- a/ironic/drivers/modules/ilo/deploy.py
+++ b/ironic/drivers/modules/ilo/deploy.py
@@ -560,9 +560,9 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
iwdi = node.driver_internal_info.get('is_whole_disk_image')
ilo_common.cleanup_vmedia_boot(task)
- uuid_dict_returned = iscsi_deploy.continue_deploy(task, **kwargs)
- root_uuid_or_disk_id = uuid_dict_returned.get(
- 'root uuid', uuid_dict_returned.get('disk identifier'))
+ uuid_dict = iscsi_deploy.continue_deploy(task, **kwargs)
+ root_uuid_or_disk_id = uuid_dict.get(
+ 'root uuid', uuid_dict.get('disk identifier'))
# TODO(rameshg87): It's not correct to return here as it will leave
# the node in DEPLOYING state. This will be fixed in bug 1405519.
@@ -609,12 +609,11 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
ilo_common.cleanup_vmedia_boot(task)
- uuid_dict_returned = iscsi_deploy.do_agent_iscsi_deploy(task,
- self._client)
- root_uuid = uuid_dict_returned.get('root uuid')
+ uuid_dict = iscsi_deploy.do_agent_iscsi_deploy(task, self._client)
+ root_uuid = uuid_dict.get('root uuid')
if iscsi_deploy.get_boot_option(node) == "local":
- efi_system_part_uuid = uuid_dict_returned.get(
+ efi_system_part_uuid = uuid_dict.get(
'efi system partition uuid')
self.configure_local_boot(
task, root_uuid=root_uuid,
diff --git a/ironic/drivers/modules/iscsi_deploy.py b/ironic/drivers/modules/iscsi_deploy.py
index cc0f301ad..87952078d 100644
--- a/ironic/drivers/modules/iscsi_deploy.py
+++ b/ironic/drivers/modules/iscsi_deploy.py
@@ -275,11 +275,15 @@ def continue_deploy(task, **kwargs):
:param kwargs: the kwargs to be passed to deploy.
:raises: InvalidState if the event is not allowed by the associated
state machine.
- :returns: a dictionary containing some identifiers for the deployed
- image. If it's partition image, then it returns root uuid and efi
- system partition uuid (if boot mode is uefi). If it's whole disk
- image, it returns disk identifier. On error cases, it returns an
- empty dictionary.
+ :returns: a dictionary containing the following keys:
+ For partition image:
+ 'root uuid': UUID of root partition
+ 'efi system partition uuid': UUID of the uefi system partition
+ (if boot mode is uefi).
+ NOTE: If key exists but value is None, it means partition doesn't
+ exist.
+ For whole disk image:
+ 'disk identifier': ID of the disk to which image was deployed.
"""
node = task.node
@@ -332,10 +336,15 @@ def do_agent_iscsi_deploy(task, agent_client):
:param agent_client: an instance of agent_client.AgentClient
which will be used during iscsi deploy (for exposing node's
target disk via iSCSI, for install boot loader, etc).
- :returns: a dictionary containing some identifiers for the deployed
- image. If it's partition image, then it returns root uuid and efi
- system partition uuid (if boot mode is uefi). If it's whole disk
- image, it returns disk identifier.
+ :returns: a dictionary containing the following keys:
+ For partition image:
+ 'root uuid': UUID of root partition
+ 'efi system partition uuid': UUID of the uefi system partition
+ (if boot mode is uefi).
+ NOTE: If key exists but value is None, it means partition doesn't
+ exist.
+ For whole disk image:
+ 'disk identifier': ID of the disk to which image was deployed.
:raises: InstanceDeployFailure, if it encounters some error
during the deploy.
"""
diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py
index a238766d7..124fe975f 100644
--- a/ironic/drivers/modules/pxe.py
+++ b/ironic/drivers/modules/pxe.py
@@ -540,9 +540,9 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
_destroy_token_file(node)
is_whole_disk_image = node.driver_internal_info['is_whole_disk_image']
- uuid_dict_returned = iscsi_deploy.continue_deploy(task, **kwargs)
- root_uuid_or_disk_id = uuid_dict_returned.get(
- 'root uuid', uuid_dict_returned.get('disk identifier'))
+ uuid_dict = iscsi_deploy.continue_deploy(task, **kwargs)
+ root_uuid_or_disk_id = uuid_dict.get(
+ 'root uuid', uuid_dict.get('disk identifier'))
# TODO(rameshg87): It's not correct to return here as it will leave
# the node in DEPLOYING state. This will be fixed in bug 1405519.
@@ -604,14 +604,13 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
# it here.
_destroy_token_file(node)
- uuid_dict_returned = iscsi_deploy.do_agent_iscsi_deploy(task,
- self._client)
+ uuid_dict = iscsi_deploy.do_agent_iscsi_deploy(task, self._client)
is_whole_disk_image = node.driver_internal_info['is_whole_disk_image']
if iscsi_deploy.get_boot_option(node) == "local":
# Install the boot loader
- root_uuid = uuid_dict_returned.get('root uuid')
- efi_sys_uuid = uuid_dict_returned.get('efi system partition uuid')
+ root_uuid = uuid_dict.get('root uuid')
+ efi_sys_uuid = uuid_dict.get('efi system partition uuid')
self.configure_local_boot(
task, root_uuid=root_uuid,
efi_system_part_uuid=efi_sys_uuid)
@@ -620,8 +619,8 @@ class VendorPassthru(agent_base_vendor.BaseAgentVendor):
# the PXE configuration files used for the deployment
pxe_utils.clean_up_pxe_config(task)
else:
- root_uuid_or_disk_id = uuid_dict_returned.get(
- 'root uuid', uuid_dict_returned.get('disk identifier'))
+ root_uuid_or_disk_id = uuid_dict.get(
+ 'root uuid', uuid_dict.get('disk identifier'))
pxe_config_path = pxe_utils.get_pxe_config_file_path(node.uuid)
boot_mode = driver_utils.get_node_capability(node, 'boot_mode')
deploy_utils.switch_pxe_config(pxe_config_path,