def __init__(self):
     """Extract configuration parameters from the configuration file."""
     self._client = importutils.import_object(conf.CISCO.nexus_driver)
     LOG.debug(_("Loaded driver %s"), conf.CISCO.nexus_driver)
     self._nexus_switches = conf.get_nexus_dictionary()
     self.credentials = {}
コード例 #2
0
# @author: Sumit Naiksatam, Cisco Systems, Inc.

import logging as LOG

from neutron.plugins.cisco.common import cisco_constants as const
from neutron.plugins.cisco.common import cisco_exceptions as cexc
from neutron.plugins.cisco.common import config
from neutron.plugins.cisco.db import network_db_v2 as cdb


LOG.basicConfig(level=LOG.WARN)
LOG.getLogger(const.LOGGER_COMPONENT_NAME)

TENANT = const.NETWORK_ADMIN

_nexus_dict = config.get_nexus_dictionary()


class Store(object):
    """Credential Store."""

    @staticmethod
    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
コード例 #3
0
 def __init__(self):
     self.nexus_switches = conf.get_nexus_dictionary()
     self.credentials = {}
     self.connections = {}