X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fauth.py;h=bb6dbba2855f8acefa54dfcc80f9c2e1e4f209af;hb=refs%2Fchanges%2F60%2F6060%2F4;hp=7b61fe1dd6e611b5dfe7a0902d61fd3cdfe731ef;hpb=181cce8e28a9b6c5c6fa1fa8aa515de3b187a2e1;p=osm%2FMON.git diff --git a/osm_mon/core/auth.py b/osm_mon/core/auth.py index 7b61fe1..bb6dbba 100644 --- a/osm_mon/core/auth.py +++ b/osm_mon/core/auth.py @@ -28,7 +28,6 @@ from osm_mon.core.database import VimCredentials, DatabaseManager class AuthManager: - def __init__(self): self.database_manager = DatabaseManager() @@ -41,14 +40,16 @@ class AuthManager: credentials.user = creds_dict['vim_user'] credentials.password = creds_dict['vim_password'] credentials.tenant_name = creds_dict['vim_tenant_name'] + 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() -