From e16367739e5a545b691c85fb9b2e178ff880d37b Mon Sep 17 00:00:00 2001 From: curious-eyes Date: Sat, 27 Feb 2016 21:43:45 +0900 Subject: [PATCH] Fix #2761: gce.py - UnboundLocalError: local variable 'md' --- lib/ansible/modules/cloud/google/gce.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ansible/modules/cloud/google/gce.py b/lib/ansible/modules/cloud/google/gce.py index ef4f89a7597..436bf35563f 100644 --- a/lib/ansible/modules/cloud/google/gce.py +++ b/lib/ansible/modules/cloud/google/gce.py @@ -404,13 +404,13 @@ def create_instances(module, gce, instance_names): except SyntaxError as e: module.fail_json(msg='bad metadata syntax') - if hasattr(libcloud, '__version__') and libcloud.__version__ < '0.15': - items = [] - for k, v in md.items(): - items.append({"key": k, "value": v}) - metadata = {'items': items} - else: - metadata = md + if hasattr(libcloud, '__version__') and libcloud.__version__ < '0.15': + items = [] + for k, v in md.items(): + items.append({"key": k, "value": v}) + metadata = {'items': items} + else: + metadata = md lc_image = LazyDiskImage(module, gce, image, lc_disks) ex_sa_perms = []