summaryrefslogtreecommitdiffstats
path: root/nova/cmd
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2013-06-12 11:31:57 -0400
committerDan Prince <dprince@redhat.com>2013-06-12 11:31:57 -0400
commit30bc1ef250f0230a9a1f562cd51b0f57d4a35912 (patch)
tree9f523ffb17a7d417a425664e924d8def35674151 /nova/cmd
parent4461f20bd6187ec02e00cd862d754df38523f9ef (diff)
Fix local variable 'root_uuid' ref before assign
Fixes an issue where the root_uuid variable gets used before it is assigned. This moves the switch_pxe_config function so that it only gets called if root_uuid is assigned. Fixes LP Bug #1190269. Change-Id: I1abaf391f3a80dcacc815d2e38c6da9ad1b099ff
Diffstat (limited to 'nova/cmd')
-rw-r--r--nova/cmd/baremetal_deploy_helper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/cmd/baremetal_deploy_helper.py b/nova/cmd/baremetal_deploy_helper.py
index d63d06ee9..539d5b517 100644
--- a/nova/cmd/baremetal_deploy_helper.py
+++ b/nova/cmd/baremetal_deploy_helper.py
@@ -201,6 +201,7 @@ def deploy(address, port, iqn, lun, image_path, pxe_config_path,
login_iscsi(address, port, iqn)
try:
root_uuid = work_on_disk(dev, root_mb, swap_mb, image_path)
+ switch_pxe_config(pxe_config_path, root_uuid)
except processutils.ProcessExecutionError as err:
# Log output if there was a error
LOG.error("Cmd : %s" % err.cmd)
@@ -208,7 +209,6 @@ def deploy(address, port, iqn, lun, image_path, pxe_config_path,
LOG.error("StdErr : %s" % err.stderr)
finally:
logout_iscsi(address, port, iqn)
- switch_pxe_config(pxe_config_path, root_uuid)
# Ensure the node started netcat on the port after POST the request.
time.sleep(3)
notify(address, 10000)