@staticmethod
def get_session(creds: dict):
- verify_ssl = False if 'insecure' in creds['config'] and creds['config']['insecure'] else True
- vim_config = creds['config']
+ verify_ssl = True
project_domain_name = 'Default'
user_domain_name = 'Default'
- if 'project_domain_name' in vim_config:
- project_domain_name = vim_config['project_domain_name']
- if 'user_domain_name' in vim_config:
- user_domain_name = vim_config['user_domain_name']
+ if 'config' in creds:
+ vim_config = creds['config']
+ verify_ssl = False if 'insecure' in vim_config and vim_config['insecure'] else True
+ if 'project_domain_name' in vim_config:
+ project_domain_name = vim_config['project_domain_name']
+ if 'user_domain_name' in vim_config:
+ user_domain_name = vim_config['user_domain_name']
auth = v3.Password(auth_url=creds['vim_url'],
username=creds['vim_user'],
password=creds['vim_password'],
vim_config_encrypted = vim_config_encrypted_dict['default']
if vim_account['schema_version'] in vim_config_encrypted_dict.keys():
vim_config_encrypted = vim_config_encrypted_dict[vim_account['schema_version']]
- for key in vim_account['config']:
- if key in vim_config_encrypted:
- vim_account['config'][key] = self.decrypt_vim_password(vim_account['config'][key],
- vim_account['schema_version'],
- vim_account_id)
+ if 'config' in vim_account:
+ for key in vim_account['config']:
+ if key in vim_config_encrypted:
+ vim_account['config'][key] = self.decrypt_vim_password(vim_account['config'][key],
+ vim_account['schema_version'],
+ vim_account_id)
return vim_account
def get_sdncs(self):