From 12596126400e54fdd6d94073db6eda1e3f456fdb Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 29 Jun 2016 09:43:57 +0200 Subject: [PATCH 6/9] fence_compute: Fix use of undefined variable --- fence/agents/compute/fence_compute.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py index b0f3c2e..8665e50 100644 --- a/fence/agents/compute/fence_compute.py +++ b/fence/agents/compute/fence_compute.py @@ -263,6 +263,8 @@ def fix_domain(options): % (options["--domain"], repr(domains))) sys.exit(1) + return last_domain + def fix_plug_name(options): if options["--action"] == "list": return @@ -270,15 +272,16 @@ def fix_plug_name(options): if "--plug" not in options: return - fix_domain(options) + calculated = fix_domain(options) + + if calculated is None or "--domain" not in options: + # Nothing supplied and nova not available... what to do... nothing + return + short_plug = options["--plug"].split('.')[0] logging.debug("Checking target '%s' against calculated domain '%s'"% (options["--plug"], calculated)) - if "--domain" not in options: - # Nothing supplied and nova not available... what to do... nothing - return - - elif options["--domain"] == "": + if options["--domain"] == "": # Ensure any domain is stripped off since nova isn't using FQDN options["--plug"] = short_plug -- 2.8.3