Fixes programmatic error in _install_grub()

The patch defines the variables before they are used in the
code.

Closes-bug: 1555547
Change-Id: I27c5e926cf4001211c4edd794a09b26559c63f71
This commit is contained in:
Nisha Agarwal 2016-03-09 17:30:19 +00:00
parent d25d94b316
commit bb605784dd
1 changed files with 2 additions and 3 deletions

View File

@ -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: