コード例 #1
0
    def __init__(self):
        fake_ucs_driver = "quantum.plugins.cisco.tests.unit.v2.ucs." + \
                          "fake_ucs_driver.CiscoUCSMFakeDriver"
        self._client = importutils.import_object(fake_ucs_driver)
        conf_parser = confp.CiscoConfigParser(curdir("fake_ucs_inventory.ini"))

        conf.INVENTORY = conf_parser.walk(conf_parser.dummy)
        for ucsm in conf.INVENTORY.keys():
            ucsm_ip = conf.INVENTORY[ucsm][const.IP_ADDRESS]
            try:
                cred.Store.put_credential(ucsm_ip, "username", "password")
            except:
                pass
        self._load_inventory()
コード例 #2
0
import logging as LOG

from quantum.common.utils import find_config_file
from quantum.plugins.cisco.common import cisco_configparser as confp
from quantum.plugins.cisco.common import cisco_constants as const
from quantum.plugins.cisco.common import cisco_exceptions as cexc
from quantum.plugins.cisco.db import l2network_db as cdb

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

CREDENTIALS_FILE = find_config_file({'plugin': 'cisco'}, "credentials.ini")
TENANT = const.NETWORK_ADMIN

cp = confp.CiscoConfigParser(CREDENTIALS_FILE)
_creds_dictionary = cp.walk(cp.dummy)


class Store(object):
    """Credential Store"""
    @staticmethod
    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
コード例 #3
0
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
# @author: Sumit Naiksatam, Cisco Systems, Inc.
# @author: Edgar Magana, Cisco Systems, Inc.
#
"""
Configuration consolidation for the Nexus Driver
This module will export the configuration parameters
from the nexus.ini file
"""

from quantum.common.utils import find_config_file
from quantum.plugins.cisco.common import cisco_configparser as confp

CP = confp.CiscoConfigParser(find_config_file({'plugin': 'cisco'},
                                              "nexus.ini"))

NEXUS_DETAILS = CP['SWITCH']

SECTION = CP['DRIVER']
NEXUS_DRIVER = SECTION['name']
コード例 #4
0
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
# @author: Sumit Naiksatam, Cisco Systems, Inc.
#

from quantum.common.utils import find_config_file
from quantum.plugins.cisco.common import cisco_configparser as confp


CP = confp.CiscoConfigParser(find_config_file({'plugin': 'cisco'},
                                              'ucs.ini'))

SECTION = CP['UCSM']
UCSM_IP_ADDRESS = SECTION['ip_address']
DEFAULT_VLAN_NAME = SECTION['default_vlan_name']
DEFAULT_VLAN_ID = SECTION['default_vlan_id']
MAX_UCSM_PORT_PROFILES = SECTION['max_ucsm_port_profiles']
PROFILE_NAME_PREFIX = SECTION['profile_name_prefix']

SECTION = CP['DRIVER']
UCSM_DRIVER = SECTION['name']

CP = confp.CiscoConfigParser(find_config_file({'plugin': 'cisco'},
                                              'ucs_inventory.ini'))

INVENTORY = CP.walk(CP.dummy)
コード例 #5
0
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc.  All rights reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
# @author: Sumit Naiksatam, Cisco Systems, Inc.
#

from quantum.common.utils import find_config_file
from quantum.plugins.cisco.common import cisco_configparser as confp

CONF_FILE = find_config_file({'plugin': 'cisco'}, "ucs_inventory.ini")
CP = confp.CiscoConfigParser(CONF_FILE)

INVENTORY = CP.walk(CP.dummy)
コード例 #6
0
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
# @author: Sumit Naiksatam, Cisco Systems, Inc.
# @author: Rohit Agarwalla, Cisco Systems, Inc.
"""

import os
from quantum.common.config import find_config_file
from quantum.plugins.cisco.common import cisco_configparser as confp

CONF_FILE = find_config_file({'plugin': 'cisco'}, None, "l2network_plugin.ini")
CONF_PARSER_OBJ = confp.CiscoConfigParser(CONF_FILE)
"""
Reading the conf for the l2network_plugin
"""
SECTION_CONF = CONF_PARSER_OBJ['VLANS']
VLAN_NAME_PREFIX = SECTION_CONF['vlan_name_prefix']
VLAN_START = SECTION_CONF['vlan_start']
VLAN_END = SECTION_CONF['vlan_end']

SECTION_CONF = CONF_PARSER_OBJ['PORTS']
MAX_PORTS = SECTION_CONF['max_ports']

SECTION_CONF = CONF_PARSER_OBJ['PORTPROFILES']
MAX_PORT_PROFILES = SECTION_CONF['max_port_profiles']

SECTION_CONF = CONF_PARSER_OBJ['NETWORKS']