From 9e68c8611838ff5f5b13f85d9e70e1fefbd9b76c Mon Sep 17 00:00:00 2001 From: Grischa Meyer Date: Thu, 29 May 2014 01:44:45 +0000 Subject: [PATCH] some fixes for the nova cloud adapter --- salt/cloud/clouds/nova.py | 3 ++- salt/utils/openstack/nova.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/salt/cloud/clouds/nova.py b/salt/cloud/clouds/nova.py index 8374d5ee10..ab1ad1d584 100644 --- a/salt/cloud/clouds/nova.py +++ b/salt/cloud/clouds/nova.py @@ -758,7 +758,8 @@ def list_nodes(call=None, **kwargs): 'image': server_tmp['image']['id'], 'size': server_tmp['flavor']['id'], 'state': server_tmp['state'], - 'private_ips': [addrs['addr'] for addrs in server_tmp['addresses']['private']], + 'private_ips': [addrs['addr'] for addrs in + server_tmp['addresses'].get('private', [])], 'public_ips': [server_tmp['accessIPv4'], server_tmp['accessIPv6']], } return ret diff --git a/salt/utils/openstack/nova.py b/salt/utils/openstack/nova.py index f91efdc85a..3cb3c261b4 100644 --- a/salt/utils/openstack/nova.py +++ b/salt/utils/openstack/nova.py @@ -153,7 +153,7 @@ class SaltNova(object): self.kwargs['bypass_url'] = get_entry( servers_endpoints, 'region', - region_name.upper() + region_name )['publicURL'] self.compute_conn = client.Client(**self.kwargs) @@ -167,7 +167,7 @@ class SaltNova(object): self.kwargs['bypass_url'] = get_entry( servers_endpoints, 'region', - region_name.upper() + region_name )['publicURL'] self.kwargs['service_type'] = 'volume'