diff options
author | Eric Johnson <erjohnso@google.com> | 2013-11-19 22:30:22 +0000 |
---|---|---|
committer | Eric Johnson <erjohnso@google.com> | 2013-11-19 22:30:22 +0000 |
commit | 8ff58eb46e53f6f1ec9438c95bdab175a8bbdaf7 (patch) | |
tree | 57bd3b53f4f91570bd564656bdf27a5e5a743759 /plugins | |
parent | 07b59da99630b906b27461c7a6be9578864c85f7 (diff) | |
download | ansible-8ff58eb46e53f6f1ec9438c95bdab175a8bbdaf7.tar.gz |
fixes #4954 plus updates for gcutil/v1beta16 tests
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/inventory/gce.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/inventory/gce.py b/plugins/inventory/gce.py index c16527ec75..22082a1e65 100755 --- a/plugins/inventory/gce.py +++ b/plugins/inventory/gce.py @@ -114,8 +114,12 @@ class GceInventory(object): def get_gce_driver(self): '''Determine GCE authorization settings and return libcloud driver.''' + gce_ini_default_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), "gce.ini") + gce_ini_path = os.environ.get('GCE_INI_PATH', gce_ini_default_path) + config = ConfigParser.SafeConfigParser() - config.read(os.path.dirname(os.path.realpath(__file__)) + '/gce.ini') + config.read(gce_ini_path) # the GCE params in 'secrets.py' will override these secrets_path = config.get('gce', 'libcloud_secrets') @@ -180,8 +184,8 @@ class GceInventory(object): 'gce_id': inst.id, 'gce_image': inst.image, 'gce_machine_type': inst.size, - 'gce_private_ip': inst.private_ip[0], - 'gce_public_ip': inst.public_ip[0], + 'gce_private_ip': inst.private_ips[0], + 'gce_public_ip': inst.public_ips[0], 'gce_name': inst.name, 'gce_description': inst.extra['description'], 'gce_status': inst.extra['status'], |