mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
AmbiguousEndpoints requires region_name
This commit is contained in:
parent
8a06fa46f9
commit
6184b24627
@ -8,6 +8,7 @@ HAS_NOVA = False
|
||||
try:
|
||||
from novaclient.v1_1 import client
|
||||
import novaclient.auth_plugin
|
||||
import novaclient.exceptions
|
||||
HAS_NOVA = True
|
||||
except ImportError:
|
||||
pass
|
||||
@ -92,8 +93,8 @@ class SaltNova(object):
|
||||
username,
|
||||
project_id,
|
||||
auth_url,
|
||||
password=None,
|
||||
region_name=None,
|
||||
password=None,
|
||||
os_auth_plugin=None,
|
||||
**kwargs
|
||||
):
|
||||
@ -120,9 +121,13 @@ class SaltNova(object):
|
||||
|
||||
self.kwargs = sanatize_novaclient(self.kwargs)
|
||||
|
||||
if not hasattr(self.conn.client, 'service_catalog':
|
||||
self.conn = client.Client(**self.kwargs)
|
||||
self.conn = client.Client(**self.kwargs)
|
||||
try:
|
||||
self.conn.authenicate()
|
||||
except novaclient.exceptions.AmbiguousEndpoints:
|
||||
raise SaltCloudSystemExit(
|
||||
"Nova provider requires a 'region_name' to be specified"
|
||||
)
|
||||
|
||||
self.kwargs['auth_token'] = self.conn.client.auth_token
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user