X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcore%2Fauth.py;h=71a817e22efc15eb2179bf52d8952b510314f82e;hb=51f4486b06781541ee15ea332261247ed3e930f6;hp=bb6dbba2855f8acefa54dfcc80f9c2e1e4f209af;hpb=b85fc8cdf840080b10d01c33b4a57a2a39bcc0f1;p=osm%2FMON.git diff --git a/osm_mon/core/auth.py b/osm_mon/core/auth.py index bb6dbba..71a817e 100644 --- a/osm_mon/core/auth.py +++ b/osm_mon/core/auth.py @@ -23,15 +23,19 @@ ## import json +import logging from osm_mon.core.database import VimCredentials, DatabaseManager +log = logging.getLogger(__name__) + class AuthManager: def __init__(self): self.database_manager = DatabaseManager() def store_auth_credentials(self, creds_dict): + log.info(creds_dict) credentials = VimCredentials() credentials.uuid = creds_dict['_id'] credentials.name = creds_dict['name'] @@ -53,3 +57,10 @@ class AuthManager: 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