From: Sumit Naiksatam Date: Wed, 31 Aug 2011 19:56:01 +0000 (-0700) Subject: Removed redundant configuration, and added more comments in the configuration files. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f932874ed1f2501406fd7509988448ffc7091a55;p=openstack-build%2Fneutron-build.git Removed redundant configuration, and added more comments in the configuration files. --- diff --git a/quantum/plugins/cisco/README b/quantum/plugins/cisco/README index d43883e29..a2c71abad 100755 --- a/quantum/plugins/cisco/README +++ b/quantum/plugins/cisco/README @@ -178,7 +178,7 @@ mysql -u -p -e "create database quantum_l2network" 6. Verify that you have the correct credentials for each IP address listed in quantum/plugins/cisco/conf/credentials.ini. Example: -# Provide the UCSM credentials +# Provide the UCSM credentials, create a separte entry for each UCSM used in your system # UCSM IP address, username and password. [10.0.0.2] username=admin @@ -190,6 +190,10 @@ password=mySecretPasswordForUCSM username=admin password=mySecretPasswordForNexus + In general, make sure that every UCSM and Nexus switch used in your system, + has a credential entry in the above file. This is required for the system to + be able to communicate with those switches. + 7. Configure the UCS systems' information in your deployment by editing the quantum/plugins/cisco/conf/ucs_inventory.ini file. You can configure multiple UCSMs per deployment, multiple chassis per UCSM, and multiple blades per diff --git a/quantum/plugins/cisco/common/cisco_nova_configuration.py b/quantum/plugins/cisco/common/cisco_nova_configuration.py deleted file mode 100644 index b26fe33a1..000000000 --- a/quantum/plugins/cisco/common/cisco_nova_configuration.py +++ /dev/null @@ -1,37 +0,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. -# -""" - -import os - -from quantum.plugins.cisco.common import cisco_configparser as confp - -CONF_FILE = "../conf/nova.ini" - -CP = confp.CiscoConfigParser(os.path.dirname(os.path.realpath(__file__)) \ - + "/" + CONF_FILE) - -SECTION = CP['NOVA'] -DB_SERVER_IP = SECTION['db_server_ip'] -DB_NAME = SECTION['db_name'] -DB_USERNAME = SECTION['db_username'] -DB_PASSWORD = SECTION['db_password'] -NOVA_HOST_NAME = SECTION['nova_host_name'] -NOVA_PROJ_NAME = SECTION['nova_proj_name'] diff --git a/quantum/plugins/cisco/common/cisco_utils.py b/quantum/plugins/cisco/common/cisco_utils.py index b5e70623b..cbfd83727 100644 --- a/quantum/plugins/cisco/common/cisco_utils.py +++ b/quantum/plugins/cisco/common/cisco_utils.py @@ -25,7 +25,6 @@ import MySQLdb import traceback from quantum.plugins.cisco.common import cisco_constants as const -from quantum.plugins.cisco.common import cisco_nova_configuration as conf from quantum.plugins.cisco.db import api as db from quantum.plugins.cisco.db import l2network_db as cdb @@ -77,35 +76,3 @@ def make_portprofile_assc_list(tenant_id, profile_id): assc_list.append(port[const.PORTID]) return assc_list - - -class DBUtils(object): - """Utilities to use connect to MySQL DB and execute queries""" - - def __init__(self): - pass - - def _get_db_connection(self): - """Get a connection to the DB""" - db_ip = conf.DB_SERVER_IP - db_username = conf.DB_USERNAME - db_password = conf.DB_PASSWORD - self.db = MySQLdb.connect(db_ip, db_username, db_password, - conf.DB_NAME) - return self.db - - def execute_db_query(self, sql_query): - """Execute a DB query""" - db = self._get_db_connection() - cursor = db.cursor() - try: - cursor.execute(sql_query) - results = cursor.fetchall() - db.commit() - LOG.debug("DB query execution succeeded: %s" % sql_query) - db.close() - except: - db.rollback() - LOG.debug("DB query execution failed: %s" % sql_query) - traceback.print_exc() - db.close() diff --git a/quantum/plugins/cisco/conf/credentials.ini b/quantum/plugins/cisco/conf/credentials.ini index 96e912cc7..ebb004ba1 100644 --- a/quantum/plugins/cisco/conf/credentials.ini +++ b/quantum/plugins/cisco/conf/credentials.ini @@ -1,13 +1,8 @@ -#Provide the UCSM credentials +#Provide the UCSM credentials, make sure you have a separate entry for every UCSM in your deployment [] username= password= -#Provide the Nova DB credentials, the IP address should be the same as in nova.ini -[] -username= -password= - #Provide the Nexus credentials, if you are using Nexus [] username= diff --git a/quantum/plugins/cisco/conf/nova.ini b/quantum/plugins/cisco/conf/nova.ini deleted file mode 100644 index 7ef5d4396..000000000 --- a/quantum/plugins/cisco/conf/nova.ini +++ /dev/null @@ -1,8 +0,0 @@ -[NOVA] -#Change the following details to reflect your OpenStack Nova configuration. If you are running this service on the same machine as the Nova DB, you do not have to change the IP address. -db_server_ip=127.0.0.1 -db_name=nova -db_username= -db_password= -nova_host_name= -nova_proj_name= diff --git a/quantum/plugins/cisco/conf/ucs.ini b/quantum/plugins/cisco/conf/ucs.ini index 431025313..73c0968b3 100644 --- a/quantum/plugins/cisco/conf/ucs.ini +++ b/quantum/plugins/cisco/conf/ucs.ini @@ -1,5 +1,6 @@ [UCSM] #change the following to the appropriate UCSM IP address +#if you have more than one UCSM, enter info from any one ip_address= default_vlan_name=default default_vlan_id=1