def initialize(): _nexus_dict = config.ML2MechCiscoConfig.nexus_dict for ipaddr, keyword in _nexus_dict.keys(): if keyword == const.USERNAME: try: cdb.add_credential(TENANT, ipaddr, _nexus_dict[ipaddr, const.USERNAME], _nexus_dict[ipaddr, 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 put_credential(cred_name, username, password): """Set the username and password.""" cdb.add_credential(TENANT, cred_name, username, password)
def _add_credential(self, test_cred): """Adds a credential to the database.""" return network_db_v2.add_credential(test_cred.tenant_id, test_cred.cred_name, test_cred.user_name, test_cred.pwd)