summaryrefslogtreecommitdiff
path: root/ironic_python_agent/extensions
diff options
context:
space:
mode:
authorNisha Agarwal <agarwalnisha1980@gmail.com>2016-03-09 17:30:19 +0000
committerNisha Agarwal <agarwalnisha1980@gmail.com>2016-03-11 21:09:37 +0000
commitbb605784dd5570310dedfdbd1b0d8a4ecf967e07 (patch)
tree6211a1ceba5c9733c3e3af442322ed4f3dc5813c /ironic_python_agent/extensions
parentd25d94b3168deb9b3183a3c59bebd4b9c9ec2463 (diff)
downloadironic-python-agent-bb605784dd5570310dedfdbd1b0d8a4ecf967e07.tar.gz
Fixes programmatic error in _install_grub()
The patch defines the variables before they are used in the code. Closes-bug: 1555547 Change-Id: I27c5e926cf4001211c4edd794a09b26559c63f71
Diffstat (limited to 'ironic_python_agent/extensions')
-rw-r--r--ironic_python_agent/extensions/image.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py
index a4edfb09..4f329903 100644
--- a/ironic_python_agent/extensions/image.py
+++ b/ironic_python_agent/extensions/image.py
@@ -82,6 +82,8 @@ def _install_grub2(device, root_uuid, efi_system_part_uuid=None):
"""Install GRUB2 bootloader on a given device."""
LOG.debug("Installing GRUB2 bootloader on device %s", device)
root_partition = _get_partition(device, uuid=root_uuid)
+ efi_partition = None
+ efi_partition_mount_point = None
try:
# Mount the partition and binds
@@ -90,9 +92,6 @@ def _install_grub2(device, root_uuid, efi_system_part_uuid=None):
if efi_system_part_uuid:
efi_partition = _get_partition(device, uuid=efi_system_part_uuid)
efi_partition_mount_point = os.path.join(path, "boot/efi")
- else:
- efi_partition = None
- efi_partition_mount_point = None
utils.execute('mount', root_partition, path)
for fs in BIND_MOUNTS: