def initialize(): for id in _creds_dictionary.keys(): try: cdb.add_credential(TENANT, id, _creds_dictionary[id][const.USERNAME], _creds_dictionary[id][const.PASSWORD]) except cexc.CredentialAlreadyExists: # We are quietly ignoring this, since it only happens # if this class module is loaded more than once, in which # case, the credentials are already populated pass
def initialize(): for keys in _nexus_dict.keys(): if keys[1] == const.USERNAME: try: cdb.add_credential(TENANT, keys[0], _nexus_dict[keys[0], const.USERNAME], _nexus_dict[keys[0], const.PASSWORD]) except cexc.CredentialAlreadyExists: # We are quietly ignoring this, since it only happens # if this class module is loaded more than once, in which # case, the credentials are already populated pass
def create_credential(self, tenant_id, credential_name, user_name, password): """Create a new credential""" LOG.debug(_("create_credential() called")) credential = cdb.add_credential(tenant_id, credential_name, user_name, password) return credential
def put_credential(cred_name, username, password): """Set the username and password.""" cdb.add_credential(TENANT, cred_name, username, password)