From 30bc1ef250f0230a9a1f562cd51b0f57d4a35912 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 12 Jun 2013 11:31:57 -0400 Subject: 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 --- nova/cmd/baremetal_deploy_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit