Merge "Fix set by merging two list without duplicate"
This commit is contained in:
commit
7110a33569
|
@ -128,8 +128,9 @@ def write_static_inventory(inventory_file_path, inventory):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
configs = _parse_config()
|
configs = _parse_config()
|
||||||
|
auth_variables = {}
|
||||||
if configs.auth_url:
|
if configs.auth_url:
|
||||||
auth_variables = {
|
auth_variables.update({
|
||||||
'auth_url': configs.auth_url,
|
'auth_url': configs.auth_url,
|
||||||
'username': configs.username,
|
'username': configs.username,
|
||||||
'project_name': configs.project_name,
|
'project_name': configs.project_name,
|
||||||
|
@ -137,13 +138,13 @@ def main():
|
||||||
'password': configs.password,
|
'password': configs.password,
|
||||||
'cacert': configs.cacert,
|
'cacert': configs.cacert,
|
||||||
'timeout': 30
|
'timeout': 30
|
||||||
}
|
})
|
||||||
elif configs.os_cloud:
|
elif configs.os_cloud:
|
||||||
config = os_client_config.OpenStackConfig()
|
config = os_client_config.OpenStackConfig()
|
||||||
for cloud in config.get_all_clouds():
|
for cloud in config.get_all_clouds():
|
||||||
if cloud.name == configs.os_cloud:
|
if cloud.name == configs.os_cloud:
|
||||||
try:
|
try:
|
||||||
auth_variables = {
|
auth_variables.update({
|
||||||
'auth_url': cloud.config['auth'].get('auth_url'),
|
'auth_url': cloud.config['auth'].get('auth_url'),
|
||||||
'username': cloud.config['auth'].get('username'),
|
'username': cloud.config['auth'].get('username'),
|
||||||
'project_name':
|
'project_name':
|
||||||
|
@ -153,7 +154,7 @@ def main():
|
||||||
'password': cloud.config['auth'].get('password'),
|
'password': cloud.config['auth'].get('password'),
|
||||||
'cacert': cloud.config.get('cacert'),
|
'cacert': cloud.config.get('cacert'),
|
||||||
'timeout': cloud.config.get('api_timeout')
|
'timeout': cloud.config.get('api_timeout')
|
||||||
}
|
})
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise KeyError("Missing values in clouds.yaml format")
|
raise KeyError("Missing values in clouds.yaml format")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -99,7 +99,7 @@ def list_plan_and_stack(hclient, swiftclient):
|
||||||
plan_list.append(ac['name'])
|
plan_list.append(ac['name'])
|
||||||
except swiftexceptions.ClientException:
|
except swiftexceptions.ClientException:
|
||||||
return None
|
return None
|
||||||
return list(set(stacks).intersection(list(plan_list)))
|
return list(set(stacks).union(plan_list))
|
||||||
|
|
||||||
|
|
||||||
def filtered(obj):
|
def filtered(obj):
|
||||||
|
|
Loading…
Reference in New Issue