X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fauth.py;h=fa80256e1e90516cda0693fd05d2651516fde244;hb=27153c4846a5caeee4a430527fd87cd322408f4b;hp=947175a927f8729a260a92d0152eefe2d08d7c95;hpb=821a62e1e29bb603de56b028d92ad885f06fd68c;p=osm%2FMON.git diff --git a/osm_mon/core/auth.py b/osm_mon/core/auth.py index 947175a..fa80256 100644 --- a/osm_mon/core/auth.py +++ b/osm_mon/core/auth.py @@ -40,14 +40,23 @@ class AuthManager: credentials.user = creds_dict['vim_user'] credentials.password = creds_dict['vim_password'] credentials.tenant_name = creds_dict['vim_tenant_name'] - if 'config' in creds_dict: - credentials.config = json.dumps(creds_dict['config']) + if 'config' not in creds_dict: + creds_dict['config'] = {} + credentials.config = json.dumps(creds_dict['config']) self.database_manager.save_credentials(credentials) def get_credentials(self, vim_uuid): - return self.database_manager.get_credentials(vim_uuid) + creds = self.database_manager.get_credentials(vim_uuid) + return creds def delete_auth_credentials(self, creds_dict): credentials = self.get_credentials(creds_dict['_id']) if credentials: credentials.delete_instance() + + def get_config(self, vim_uuid): + return json.loads(self.get_credentials(vim_uuid).config) + + def is_verify_ssl(self, vim_uuid): + vim_config = self.get_config(vim_uuid) + return 'insecure' not in vim_config or vim_config['insecure'] is False