diff --git a/quantum/plugins/cisco/common/cisco_faults.py b/quantum/plugins/cisco/common/cisco_faults.py index fea32c22cd..d8c746220d 100644 --- a/quantum/plugins/cisco/common/cisco_faults.py +++ b/quantum/plugins/cisco/common/cisco_faults.py @@ -70,9 +70,9 @@ class PortprofileNotFound(webob.exc.HTTPClientError): code: 450, title: Portprofile not Found """ code = 450 - title = 'Portprofile Not Found' - explanation = ('Unable to find a Portprofile with' - ' the specified identifier.') + title = _('Portprofile Not Found') + explanation = _('Unable to find a Portprofile with' + ' the specified identifier.') class PortNotFound(webob.exc.HTTPClientError): @@ -85,8 +85,8 @@ class PortNotFound(webob.exc.HTTPClientError): code: 430, title: Port not Found """ code = 430 - title = 'Port not Found' - explanation = ('Unable to find a port with the specified identifier.') + title = _('Port not Found') + explanation = _('Unable to find a port with the specified identifier.') class CredentialNotFound(webob.exc.HTTPClientError): @@ -99,9 +99,9 @@ class CredentialNotFound(webob.exc.HTTPClientError): code: 451, title: Credential not Found """ code = 451 - title = 'Credential Not Found' - explanation = ('Unable to find a Credential with' - ' the specified identifier.') + title = _('Credential Not Found') + explanation = _('Unable to find a Credential with' + ' the specified identifier.') class QosNotFound(webob.exc.HTTPClientError): @@ -114,9 +114,9 @@ class QosNotFound(webob.exc.HTTPClientError): code: 452, title: QoS not Found """ code = 452 - title = 'QoS Not Found' - explanation = ('Unable to find a QoS with' - ' the specified identifier.') + title = _('QoS Not Found') + explanation = _('Unable to find a QoS with' + ' the specified identifier.') class NovatenantNotFound(webob.exc.HTTPClientError): @@ -129,9 +129,9 @@ class NovatenantNotFound(webob.exc.HTTPClientError): code: 453, title: Nova tenant not Found """ code = 453 - title = 'Nova tenant Not Found' - explanation = ('Unable to find a Novatenant with' - ' the specified identifier.') + title = _('Nova tenant Not Found') + explanation = _('Unable to find a Novatenant with' + ' the specified identifier.') class MultiportNotFound(webob.exc.HTTPClientError): @@ -144,9 +144,9 @@ class MultiportNotFound(webob.exc.HTTPClientError): code: 454, title: Multiport not Found """ code = 454 - title = 'Multiport Not Found' - explanation = ('Unable to find Multiport with' - ' the specified identifier.') + title = _('Multiport Not Found') + explanation = _('Unable to find Multiport with' + ' the specified identifier.') class RequestedStateInvalid(webob.exc.HTTPClientError): @@ -159,5 +159,5 @@ class RequestedStateInvalid(webob.exc.HTTPClientError): code: 431, title: Requested State Invalid """ code = 431 - title = 'Requested State Invalid' - explanation = ('Unable to update port state with specified value.') + title = _('Requested State Invalid') + explanation = _('Unable to update port state with specified value.') diff --git a/quantum/plugins/cisco/db/l2network_db.py b/quantum/plugins/cisco/db/l2network_db.py index 8b252771eb..51bce41992 100644 --- a/quantum/plugins/cisco/db/l2network_db.py +++ b/quantum/plugins/cisco/db/l2network_db.py @@ -35,7 +35,7 @@ def initialize(): def create_vlanids(): """Prepopulates the vlan_bindings table""" - LOG.debug("create_vlanids() called") + LOG.debug(_("create_vlanids() called")) session = db.get_session() try: vlanid = session.query(l2network_models.VlanID).one() @@ -54,7 +54,7 @@ def create_vlanids(): def get_all_vlanids(): """Gets all the vlanids""" - LOG.debug("get_all_vlanids() called") + LOG.debug(_("get_all_vlanids() called")) session = db.get_session() try: vlanids = session.query(l2network_models.VlanID).all() @@ -65,7 +65,7 @@ def get_all_vlanids(): def is_vlanid_used(vlan_id): """Checks if a vlanid is in use""" - LOG.debug("is_vlanid_used() called") + LOG.debug(_("is_vlanid_used() called")) session = db.get_session() try: vlanid = (session.query(l2network_models.VlanID). @@ -77,7 +77,7 @@ def is_vlanid_used(vlan_id): def release_vlanid(vlan_id): """Sets the vlanid state to be unused""" - LOG.debug("release_vlanid() called") + LOG.debug(_("release_vlanid() called")) session = db.get_session() try: vlanid = (session.query(l2network_models.VlanID). @@ -93,7 +93,7 @@ def release_vlanid(vlan_id): def delete_vlanid(vlan_id): """Deletes a vlanid entry from db""" - LOG.debug("delete_vlanid() called") + LOG.debug(_("delete_vlanid() called")) session = db.get_session() try: vlanid = (session.query(l2network_models.VlanID). @@ -107,7 +107,7 @@ def delete_vlanid(vlan_id): def reserve_vlanid(): """Reserves the first unused vlanid""" - LOG.debug("reserve_vlanid() called") + LOG.debug(_("reserve_vlanid() called")) session = db.get_session() try: rvlan = (session.query(l2network_models.VlanID). @@ -126,7 +126,7 @@ def reserve_vlanid(): def get_all_vlanids_used(): """Gets all the vlanids used""" - LOG.debug("get_all_vlanids() called") + LOG.debug(_("get_all_vlanids() called")) session = db.get_session() try: vlanids = (session.query(l2network_models.VlanID). @@ -138,7 +138,7 @@ def get_all_vlanids_used(): def get_all_vlan_bindings(): """Lists all the vlan to network associations""" - LOG.debug("get_all_vlan_bindings() called") + LOG.debug(_("get_all_vlan_bindings() called")) session = db.get_session() try: bindings = session.query(l2network_models.VlanBinding).all() @@ -149,7 +149,7 @@ def get_all_vlan_bindings(): def get_vlan_binding(netid): """Lists the vlan given a network_id""" - LOG.debug("get_vlan_binding() called") + LOG.debug(_("get_vlan_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.VlanBinding). @@ -161,7 +161,7 @@ def get_vlan_binding(netid): def add_vlan_binding(vlanid, vlanname, netid): """Adds a vlan to network association""" - LOG.debug("add_vlan_binding() called") + LOG.debug(_("add_vlan_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.VlanBinding). @@ -177,7 +177,7 @@ def add_vlan_binding(vlanid, vlanname, netid): def remove_vlan_binding(netid): """Removes a vlan to network association""" - LOG.debug("remove_vlan_binding() called") + LOG.debug(_("remove_vlan_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.VlanBinding). @@ -191,7 +191,7 @@ def remove_vlan_binding(netid): def update_vlan_binding(netid, newvlanid=None, newvlanname=None): """Updates a vlan to network association""" - LOG.debug("update_vlan_binding() called") + LOG.debug(_("update_vlan_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.VlanBinding). @@ -209,7 +209,7 @@ def update_vlan_binding(netid, newvlanid=None, newvlanname=None): def get_all_portprofiles(): """Lists all the port profiles""" - LOG.debug("get_all_portprofiles() called") + LOG.debug(_("get_all_portprofiles() called")) session = db.get_session() try: pps = session.query(l2network_models.PortProfile).all() @@ -220,7 +220,7 @@ def get_all_portprofiles(): def get_portprofile(tenantid, ppid): """Lists a port profile""" - LOG.debug("get_portprofile() called") + LOG.debug(_("get_portprofile() called")) session = db.get_session() try: pp = (session.query(l2network_models.PortProfile). @@ -233,7 +233,7 @@ def get_portprofile(tenantid, ppid): def add_portprofile(tenantid, ppname, vlanid, qos): """Adds a port profile""" - LOG.debug("add_portprofile() called") + LOG.debug(_("add_portprofile() called")) session = db.get_session() try: pp = (session.query(l2network_models.PortProfile). @@ -249,7 +249,7 @@ def add_portprofile(tenantid, ppname, vlanid, qos): def remove_portprofile(tenantid, ppid): """Removes a port profile""" - LOG.debug("remove_portprofile() called") + LOG.debug(_("remove_portprofile() called")) session = db.get_session() try: pp = (session.query(l2network_models.PortProfile). @@ -264,7 +264,7 @@ def remove_portprofile(tenantid, ppid): def update_portprofile(tenantid, ppid, newppname=None, newvlanid=None, newqos=None): """Updates port profile""" - LOG.debug("update_portprofile() called") + LOG.debug(_("update_portprofile() called")) session = db.get_session() try: pp = (session.query(l2network_models.PortProfile). @@ -285,7 +285,7 @@ def update_portprofile(tenantid, ppid, newppname=None, newvlanid=None, def get_all_pp_bindings(): """Lists all the port profiles""" - LOG.debug("get_all_pp_bindings() called") + LOG.debug(_("get_all_pp_bindings() called")) session = db.get_session() try: bindings = session.query(l2network_models.PortProfileBinding).all() @@ -296,7 +296,7 @@ def get_all_pp_bindings(): def get_pp_binding(tenantid, ppid): """Lists a port profile binding""" - LOG.debug("get_pp_binding() called") + LOG.debug(_("get_pp_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.PortProfileBinding). @@ -308,7 +308,7 @@ def get_pp_binding(tenantid, ppid): def add_pp_binding(tenantid, portid, ppid, default): """Adds a port profile binding""" - LOG.debug("add_pp_binding() called") + LOG.debug(_("add_pp_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.PortProfileBinding). @@ -325,7 +325,7 @@ def add_pp_binding(tenantid, portid, ppid, default): def remove_pp_binding(tenantid, portid, ppid): """Removes a port profile binding""" - LOG.debug("remove_pp_binding() called") + LOG.debug(_("remove_pp_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.PortProfileBinding). @@ -341,7 +341,7 @@ def remove_pp_binding(tenantid, portid, ppid): def update_pp_binding(tenantid, ppid, newtenantid=None, newportid=None, newdefault=None): """Updates port profile binding""" - LOG.debug("update_pp_binding() called") + LOG.debug(_("update_pp_binding() called")) session = db.get_session() try: binding = (session.query(l2network_models.PortProfileBinding). @@ -362,7 +362,7 @@ def update_pp_binding(tenantid, ppid, newtenantid=None, def get_all_qoss(tenant_id): """Lists all the qos to tenant associations""" - LOG.debug("get_all_qoss() called") + LOG.debug(_("get_all_qoss() called")) session = db.get_session() try: qoss = (session.query(l2network_models.QoS). @@ -374,7 +374,7 @@ def get_all_qoss(tenant_id): def get_qos(tenant_id, qos_id): """Lists the qos given a tenant_id and qos_id""" - LOG.debug("get_qos() called") + LOG.debug(_("get_qos() called")) session = db.get_session() try: qos = (session.query(l2network_models.QoS). @@ -388,7 +388,7 @@ def get_qos(tenant_id, qos_id): def add_qos(tenant_id, qos_name, qos_desc): """Adds a qos to tenant association""" - LOG.debug("add_qos() called") + LOG.debug(_("add_qos() called")) session = db.get_session() try: qos = (session.query(l2network_models.QoS). diff --git a/quantum/plugins/cisco/db/network_db_v2.py b/quantum/plugins/cisco/db/network_db_v2.py index d04985d875..bc08a7be4a 100644 --- a/quantum/plugins/cisco/db/network_db_v2.py +++ b/quantum/plugins/cisco/db/network_db_v2.py @@ -38,7 +38,7 @@ def initialize(): def create_vlanids(): """Prepopulates the vlan_bindings table""" - LOG.debug("create_vlanids() called") + LOG.debug(_("create_vlanids() called")) session = db.get_session() try: vlanid = session.query(network_models_v2.VlanID).one() @@ -57,7 +57,7 @@ def create_vlanids(): def get_all_vlanids(): """Gets all the vlanids""" - LOG.debug("get_all_vlanids() called") + LOG.debug(_("get_all_vlanids() called")) session = db.get_session() try: vlanids = session.query(network_models_v2.VlanID).all() @@ -68,7 +68,7 @@ def get_all_vlanids(): def is_vlanid_used(vlan_id): """Checks if a vlanid is in use""" - LOG.debug("is_vlanid_used() called") + LOG.debug(_("is_vlanid_used() called")) session = db.get_session() try: vlanid = (session.query(network_models_v2.VlanID). @@ -80,7 +80,7 @@ def is_vlanid_used(vlan_id): def release_vlanid(vlan_id): """Sets the vlanid state to be unused""" - LOG.debug("release_vlanid() called") + LOG.debug(_("release_vlanid() called")) session = db.get_session() try: vlanid = (session.query(network_models_v2.VlanID). @@ -96,7 +96,7 @@ def release_vlanid(vlan_id): def delete_vlanid(vlan_id): """Deletes a vlanid entry from db""" - LOG.debug("delete_vlanid() called") + LOG.debug(_("delete_vlanid() called")) session = db.get_session() try: vlanid = (session.query(network_models_v2.VlanID). @@ -110,7 +110,7 @@ def delete_vlanid(vlan_id): def reserve_vlanid(): """Reserves the first unused vlanid""" - LOG.debug("reserve_vlanid() called") + LOG.debug(_("reserve_vlanid() called")) session = db.get_session() try: rvlan = (session.query(network_models_v2.VlanID). @@ -129,7 +129,7 @@ def reserve_vlanid(): def get_all_vlanids_used(): """Gets all the vlanids used""" - LOG.debug("get_all_vlanids() called") + LOG.debug(_("get_all_vlanids() called")) session = db.get_session() try: vlanids = (session.query(network_models_v2.VlanID). @@ -141,7 +141,7 @@ def get_all_vlanids_used(): def get_all_vlan_bindings(): """Lists all the vlan to network associations""" - LOG.debug("get_all_vlan_bindings() called") + LOG.debug(_("get_all_vlan_bindings() called")) session = db.get_session() try: bindings = session.query(network_models_v2.Vlan_Binding).all() @@ -152,7 +152,7 @@ def get_all_vlan_bindings(): def get_vlan_binding(netid): """Lists the vlan given a network_id""" - LOG.debug("get_vlan_binding() called") + LOG.debug(_("get_vlan_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.Vlan_Binding). @@ -164,7 +164,7 @@ def get_vlan_binding(netid): def add_vlan_binding(vlanid, vlanname, netid): """Adds a vlan to network association""" - LOG.debug("add_vlan_binding() called") + LOG.debug(_("add_vlan_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.Vlan_Binding). @@ -180,7 +180,7 @@ def add_vlan_binding(vlanid, vlanname, netid): def remove_vlan_binding(netid): """Removes a vlan to network association""" - LOG.debug("remove_vlan_binding() called") + LOG.debug(_("remove_vlan_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.Vlan_Binding). @@ -194,7 +194,7 @@ def remove_vlan_binding(netid): def update_vlan_binding(netid, newvlanid=None, newvlanname=None): """Updates a vlan to network association""" - LOG.debug("update_vlan_binding() called") + LOG.debug(_("update_vlan_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.Vlan_Binding). @@ -212,7 +212,7 @@ def update_vlan_binding(netid, newvlanid=None, newvlanname=None): def get_all_portprofiles(): """Lists all the port profiles""" - LOG.debug("get_all_portprofiles() called") + LOG.debug(_("get_all_portprofiles() called")) session = db.get_session() try: pps = session.query(network_models_v2.PortProfile).all() @@ -223,7 +223,7 @@ def get_all_portprofiles(): def get_portprofile(tenantid, ppid): """Lists a port profile""" - LOG.debug("get_portprofile() called") + LOG.debug(_("get_portprofile() called")) session = db.get_session() try: pp = (session.query(network_models_v2.PortProfile). @@ -236,7 +236,7 @@ def get_portprofile(tenantid, ppid): def add_portprofile(tenantid, ppname, vlanid, qos): """Adds a port profile""" - LOG.debug("add_portprofile() called") + LOG.debug(_("add_portprofile() called")) session = db.get_session() try: pp = (session.query(network_models_v2.PortProfile). @@ -267,7 +267,7 @@ def remove_portprofile(tenantid, ppid): def update_portprofile(tenantid, ppid, newppname=None, newvlanid=None, newqos=None): """Updates port profile""" - LOG.debug("update_portprofile() called") + LOG.debug(_("update_portprofile() called")) session = db.get_session() try: pp = (session.query(network_models_v2.PortProfile). @@ -288,7 +288,7 @@ def update_portprofile(tenantid, ppid, newppname=None, newvlanid=None, def get_all_pp_bindings(): """Lists all the port profiles""" - LOG.debug("get_all_pp_bindings() called") + LOG.debug(_("get_all_pp_bindings() called")) session = db.get_session() try: bindings = session.query(network_models_v2.PortProfileBinding).all() @@ -299,7 +299,7 @@ def get_all_pp_bindings(): def get_pp_binding(tenantid, ppid): """Lists a port profile binding""" - LOG.debug("get_pp_binding() called") + LOG.debug(_("get_pp_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.PortProfileBinding). @@ -311,7 +311,7 @@ def get_pp_binding(tenantid, ppid): def add_pp_binding(tenantid, portid, ppid, default): """Adds a port profile binding""" - LOG.debug("add_pp_binding() called") + LOG.debug(_("add_pp_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.PortProfileBinding). @@ -328,7 +328,7 @@ def add_pp_binding(tenantid, portid, ppid, default): def remove_pp_binding(tenantid, portid, ppid): """Removes a port profile binding""" - LOG.debug("remove_pp_binding() called") + LOG.debug(_("remove_pp_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.PortProfileBinding). @@ -344,7 +344,7 @@ def remove_pp_binding(tenantid, portid, ppid): def update_pp_binding(tenantid, ppid, newtenantid=None, newportid=None, newdefault=None): """Updates port profile binding""" - LOG.debug("update_pp_binding() called") + LOG.debug(_("update_pp_binding() called")) session = db.get_session() try: binding = (session.query(network_models_v2.PortProfileBinding). @@ -365,7 +365,7 @@ def update_pp_binding(tenantid, ppid, newtenantid=None, def get_all_qoss(tenant_id): """Lists all the qos to tenant associations""" - LOG.debug("get_all_qoss() called") + LOG.debug(_("get_all_qoss() called")) session = db.get_session() try: qoss = (session.query(network_models_v2.QoS). @@ -377,7 +377,7 @@ def get_all_qoss(tenant_id): def get_qos(tenant_id, qos_id): """Lists the qos given a tenant_id and qos_id""" - LOG.debug("get_qos() called") + LOG.debug(_("get_qos() called")) session = db.get_session() try: qos = (session.query(network_models_v2.QoS). @@ -391,7 +391,7 @@ def get_qos(tenant_id, qos_id): def add_qos(tenant_id, qos_name, qos_desc): """Adds a qos to tenant association""" - LOG.debug("add_qos() called") + LOG.debug(_("add_qos() called")) session = db.get_session() try: qos = (session.query(network_models_v2.QoS). diff --git a/quantum/plugins/cisco/db/nexus_db_v2.py b/quantum/plugins/cisco/db/nexus_db_v2.py index b5f35dd8fa..0f95120484 100644 --- a/quantum/plugins/cisco/db/nexus_db_v2.py +++ b/quantum/plugins/cisco/db/nexus_db_v2.py @@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__) def get_all_nexusport_bindings(): """Lists all the nexusport bindings""" - LOG.debug("get_all_nexusport_bindings() called") + LOG.debug(_("get_all_nexusport_bindings() called")) session = db.get_session() try: bindings = session.query(nexus_models_v2.NexusPortBinding).all() @@ -42,7 +42,7 @@ def get_all_nexusport_bindings(): def get_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): """Lists a nexusport binding""" - LOG.debug("get_nexusport_binding() called") + LOG.debug(_("get_nexusport_binding() called")) session = db.get_session() try: binding = (session.query(nexus_models_v2.NexusPortBinding). @@ -56,7 +56,7 @@ def get_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): def get_nexusvlan_binding(vlan_id, switch_ip): """Lists a vlan and switch binding""" - LOG.debug("get_nexusvlan_binding() called") + LOG.debug(_("get_nexusvlan_binding() called")) session = db.get_session() try: binding = (session.query(nexus_models_v2.NexusPortBinding). @@ -69,7 +69,7 @@ def get_nexusvlan_binding(vlan_id, switch_ip): def add_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): """Adds a nexusport binding""" - LOG.debug("add_nexusport_binding() called") + LOG.debug(_("add_nexusport_binding() called")) session = db.get_session() binding = nexus_models_v2.NexusPortBinding( port_id, vlan_id, switch_ip, instance_id) @@ -80,7 +80,7 @@ def add_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): def remove_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): """Removes a nexusport binding""" - LOG.debug("remove_nexusport_binding() called") + LOG.debug(_("remove_nexusport_binding() called")) session = db.get_session() try: binding = (session.query(nexus_models_v2.NexusPortBinding). @@ -98,7 +98,7 @@ def remove_nexusport_binding(port_id, vlan_id, switch_ip, instance_id): def update_nexusport_binding(port_id, new_vlan_id): """Updates nexusport binding""" - LOG.debug("update_nexusport_binding called") + LOG.debug(_("update_nexusport_binding called")) session = db.get_session() try: binding = (session.query(nexus_models_v2.NexusPortBinding). @@ -114,7 +114,7 @@ def update_nexusport_binding(port_id, new_vlan_id): def get_nexusvm_binding(vlan_id, instance_id): """Lists nexusvm bindings""" - LOG.debug("get_nexusvm_binding() called") + LOG.debug(_("get_nexusvm_binding() called")) session = db.get_session() try: binding = (session.query(nexus_models_v2.NexusPortBinding). @@ -127,7 +127,7 @@ def get_nexusvm_binding(vlan_id, instance_id): def get_port_vlan_switch_binding(port_id, vlan_id, switch_ip): """Lists nexusvm bindings""" - LOG.debug("get_port_vlan_switch_binding() called") + LOG.debug(_("get_port_vlan_switch_binding() called")) session = db.get_session() try: binding = (session.query(nexus_models_v2.NexusPortBinding). diff --git a/quantum/plugins/cisco/db/services_db.py b/quantum/plugins/cisco/db/services_db.py index d38d817a3f..65554a273c 100644 --- a/quantum/plugins/cisco/db/services_db.py +++ b/quantum/plugins/cisco/db/services_db.py @@ -27,7 +27,7 @@ from quantum.plugins.cisco.db import services_models def get_all_services_bindings(): """Lists all the services bindings""" - LOG.debug("get_all_services_bindings() called") + LOG.debug(_("get_all_services_bindings() called")) session = db.get_session() try: bindings = session.query(services_models.ServicesBinding).all() @@ -38,7 +38,7 @@ def get_all_services_bindings(): def get_service_bindings(service_id): """Lists services bindings for a service_id""" - LOG.debug("get_service_bindings() called") + LOG.debug(_("get_service_bindings() called")) session = db.get_session() try: bindings = (session.query(services_models.ServicesBinding). @@ -50,7 +50,7 @@ def get_service_bindings(service_id): def add_services_binding(service_id, mngnet_id, nbnet_id, sbnet_id): """Adds a services binding""" - LOG.debug("add_services_binding() called") + LOG.debug(_("add_services_binding() called")) session = db.get_session() binding = services_models.ServicesBinding(service_id, mngnet_id, nbnet_id, sbnet_id) @@ -61,7 +61,7 @@ def add_services_binding(service_id, mngnet_id, nbnet_id, sbnet_id): def remove_services_binding(service_id): """Removes a services binding""" - LOG.debug("remove_services_binding() called") + LOG.debug(_("remove_services_binding() called")) session = db.get_session() try: binding = (session.query(services_models.ServicesBinding). diff --git a/quantum/plugins/cisco/db/ucs_db_v2.py b/quantum/plugins/cisco/db/ucs_db_v2.py index a8c5f5f68d..fcda48866a 100644 --- a/quantum/plugins/cisco/db/ucs_db_v2.py +++ b/quantum/plugins/cisco/db/ucs_db_v2.py @@ -27,7 +27,7 @@ from quantum.plugins.cisco.db import ucs_models_v2 as ucs_models def get_all_portbindings(): """Lists all the port bindings""" - LOG.debug("db get_all_portbindings() called") + LOG.debug(_("DB get_all_portbindings() called")) session = db.get_session() try: port_bindings = session.query(ucs_models.PortBinding).all() @@ -38,7 +38,7 @@ def get_all_portbindings(): def get_portbinding(port_id): """Lists a port binding""" - LOG.debug("get_portbinding() called") + LOG.debug(_("get_portbinding() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). @@ -51,7 +51,7 @@ def get_portbinding(port_id): def add_portbinding(port_id, blade_intf_dn, portprofile_name, vlan_name, vlan_id, qos): """Adds a port binding""" - LOG.debug("add_portbinding() called") + LOG.debug(_("add_portbinding() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). @@ -68,7 +68,7 @@ def add_portbinding(port_id, blade_intf_dn, portprofile_name, def remove_portbinding(port_id): """Removes a port binding""" - LOG.debug("db remove_portbinding() called") + LOG.debug(_("DB remove_portbinding() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). @@ -85,7 +85,7 @@ def update_portbinding(port_id, blade_intf_dn=None, portprofile_name=None, tenant_id=None, instance_id=None, vif_id=None): """Updates port binding""" - LOG.debug("db update_portbinding() called") + LOG.debug(_("DB update_portbinding() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). @@ -115,7 +115,7 @@ def update_portbinding(port_id, blade_intf_dn=None, portprofile_name=None, def update_portbinding_instance_id(port_id, instance_id): """Updates port binding for the instance ID""" - LOG.debug("db update_portbinding_instance_id() called") + LOG.debug(_("DB update_portbinding_instance_id() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). @@ -130,7 +130,7 @@ def update_portbinding_instance_id(port_id, instance_id): def update_portbinding_vif_id(port_id, vif_id): """Updates port binding for the VIF ID""" - LOG.debug("db update_portbinding_vif_id() called") + LOG.debug(_("DB update_portbinding_vif_id() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). @@ -145,7 +145,7 @@ def update_portbinding_vif_id(port_id, vif_id): def get_portbinding_dn(blade_intf_dn): """Lists a port binding""" - LOG.debug("get_portbinding_dn() called") + LOG.debug(_("get_portbinding_dn() called")) session = db.get_session() try: port_binding = (session.query(ucs_models.PortBinding). diff --git a/quantum/plugins/cisco/models/network_multi_blade_v2.py b/quantum/plugins/cisco/models/network_multi_blade_v2.py index 1f55bfdcd1..e477632917 100644 --- a/quantum/plugins/cisco/models/network_multi_blade_v2.py +++ b/quantum/plugins/cisco/models/network_multi_blade_v2.py @@ -53,15 +53,17 @@ class NetworkMultiBladeV2(quantum_plugin_base_v2.QuantumPluginBaseV2): for key in conf.PLUGINS[const.PLUGINS].keys(): plugin_obj = conf.PLUGINS[const.PLUGINS][key] self._plugins[key] = importutils.import_object(plugin_obj) - LOG.debug("Loaded device plugin %s\n" % + LOG.debug(_("Loaded device plugin %s"), conf.PLUGINS[const.PLUGINS][key]) if key in conf.PLUGINS[const.INVENTORY].keys(): inventory_obj = conf.PLUGINS[const.INVENTORY][key] self._inventory[key] = importutils.import_object(inventory_obj) - LOG.debug("Loaded device inventory %s\n" % + LOG.debug(_("Loaded device inventory %s"), conf.PLUGINS[const.INVENTORY][key]) - LOG.debug("%s.%s init done" % (__name__, self.__class__.__name__)) + LOG.debug(_("%(module)s.%(name)s init done"), + {'module': __name__, + 'name': self.__class__.__name__}) def _func_name(self, offset=0): """Get the name of the calling function""" @@ -73,9 +75,9 @@ class NetworkMultiBladeV2(quantum_plugin_base_v2.QuantumPluginBaseV2): inventory and plugin implementation) for completing this operation. """ if not plugin_key in self._plugins.keys(): - LOG.info("No %s Plugin loaded" % plugin_key) - LOG.info("%s: %s with args %s ignored" % - (plugin_key, function_name, args)) + LOG.info(_("No %s Plugin loaded"), plugin_key) + LOG.info(_("%(plugin_key)s: %(function_name)s with args %(args)s " + "ignored"), locals()) return device_params = self._invoke_inventory(plugin_key, function_name, args) @@ -98,9 +100,9 @@ class NetworkMultiBladeV2(quantum_plugin_base_v2.QuantumPluginBaseV2): inventory for completing this operation. """ if not plugin_key in self._inventory.keys(): - LOG.info("No %s inventory loaded" % plugin_key) - LOG.info("%s: %s with args %s ignored" % - (plugin_key, function_name, args)) + LOG.info(_("No %s inventory loaded"), plugin_key) + LOG.info(_("%(plugin_key)s: %(function_name)s with args %(args)s " + "ignored"), locals()) return {const.DEVICE_IP: []} else: return getattr(self._inventory[plugin_key], function_name)(args) diff --git a/quantum/plugins/cisco/models/virt_phy_sw_v2.py b/quantum/plugins/cisco/models/virt_phy_sw_v2.py index 49c26b5a33..ed2230c498 100644 --- a/quantum/plugins/cisco/models/virt_phy_sw_v2.py +++ b/quantum/plugins/cisco/models/virt_phy_sw_v2.py @@ -66,12 +66,12 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): for key in conf.PLUGINS[const.PLUGINS].keys(): plugin_obj = conf.PLUGINS[const.PLUGINS][key] self._plugins[key] = importutils.import_object(plugin_obj) - LOG.debug("Loaded device plugin %s\n" % + LOG.debug(_("Loaded device plugin %s\n"), conf.PLUGINS[const.PLUGINS][key]) if key in conf.PLUGINS[const.INVENTORY].keys(): inventory_obj = conf.PLUGINS[const.INVENTORY][key] self._inventory[key] = importutils.import_object(inventory_obj) - LOG.debug("Loaded device inventory %s\n" % + LOG.debug(_("Loaded device inventory %s\n"), conf.PLUGINS[const.INVENTORY][key]) if hasattr(self._plugins[const.VSWITCH_PLUGIN], @@ -80,7 +80,9 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): self._plugins[const.VSWITCH_PLUGIN]. supported_extension_aliases) - LOG.debug("%s.%s init done" % (__name__, self.__class__.__name__)) + LOG.debug(_("%(module)s.%(name)s init done"), + {'module': __name__, + 'name': self.__class__.__name__}) def __getattribute__(self, name): """ @@ -113,9 +115,9 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): inventory and plugin implementation) for completing this operation. """ if not plugin_key in self._plugins.keys(): - LOG.info("No %s Plugin loaded" % plugin_key) - LOG.info("%s: %s with args %s ignored" % - (plugin_key, function_name, args)) + LOG.info(_("No %s Plugin loaded"), plugin_key) + LOG.info(_("%(plugin_key)s: %(function_name)s with args %(args)s " + "ignored"), locals()) return device_params = self._invoke_inventory(plugin_key, function_name, args) @@ -138,9 +140,9 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): inventory for completing this operation. """ if not plugin_key in self._inventory.keys(): - LOG.info("No %s inventory loaded" % plugin_key) - LOG.info("%s: %s with args %s ignored" % - (plugin_key, function_name, args)) + LOG.info(_("No %s inventory loaded"), plugin_key) + LOG.info(_("%(plugin_key)s: %(function_name)s with args %(args)s " + "ignored"), locals()) return {const.DEVICE_IP: []} else: return getattr(self._inventory[plugin_key], function_name)(args) @@ -208,7 +210,7 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): Perform this operation in the context of the configured device plugins. """ - LOG.debug("create_network() called\n") + LOG.debug(_("create_network() called")) try: args = [context, network] ovs_output = self._invoke_plugin_per_device(const.VSWITCH_PLUGIN, @@ -232,12 +234,12 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): Perform this operation in the context of the configured device plugins. """ - LOG.debug("create_network_bulk() called\n") + LOG.debug(_("create_network_bulk() called")) try: args = [context, networks] ovs_output = self._plugins[ const.VSWITCH_PLUGIN].create_network_bulk(context, networks) - LOG.debug("ovs_output: %s\n " % ovs_output) + LOG.debug(_("ovs_output: %s"), ovs_output) vlanids = self._get_all_segmentation_ids() ovs_networks = ovs_output return ovs_output @@ -250,7 +252,7 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): Perform this operation in the context of the configured device plugins. """ - LOG.debug("update_network() called\n") + LOG.debug(_("update_network() called")) args = [context, id, network] ovs_output = self._invoke_plugin_per_device(const.VSWITCH_PLUGIN, self._func_name(), @@ -304,7 +306,7 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): Perform this operation in the context of the configured device plugins. """ - LOG.debug("create_port() called\n") + LOG.debug(_("create_port() called")) try: args = [context, port] ovs_output = self._invoke_plugin_per_device(const.VSWITCH_PLUGIN, @@ -353,7 +355,7 @@ class VirtualPhysicalSwitchModelV2(quantum_plugin_base_v2.QuantumPluginBaseV2): Perform this operation in the context of the configured device plugins. """ - LOG.debug("delete_port() called\n") + LOG.debug(_("delete_port() called")) try: args = [context, id] port = self.get_port(context, id) diff --git a/quantum/plugins/cisco/network_plugin.py b/quantum/plugins/cisco/network_plugin.py index 8648071b46..6c728f5e92 100644 --- a/quantum/plugins/cisco/network_plugin.py +++ b/quantum/plugins/cisco/network_plugin.py @@ -58,7 +58,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): self._model = importutils.import_object(conf.MODEL_CLASS) if hasattr(self._model, "MANAGE_STATE") and self._model.MANAGE_STATE: self._master = False - LOG.debug("Model %s manages state" % conf.MODEL_CLASS) + LOG.debug(_("Model %s manages state"), conf.MODEL_CLASS) native_bulk_attr_name = ("_%s__native_bulk_support" % self._model.__class__.__name__) self.__native_bulk_support = getattr(self._model, @@ -69,7 +69,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): self._model.supported_extension_aliases) super(PluginV2, self).__init__() - LOG.debug("Plugin initialization complete") + LOG.debug(_("Plugin initialization complete")) def __getattribute__(self, name): """ @@ -105,7 +105,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): Creates a new Virtual Network, and assigns it a symbolic name. """ - LOG.debug("create_network() called\n") + LOG.debug(_("create_network() called")) new_network = super(PluginV2, self).create_network(context, network) try: @@ -122,7 +122,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): Updates the symbolic name belonging to a particular Virtual Network. """ - LOG.debug("update_network() called\n") + LOG.debug(_("update_network() called")) upd_net_dict = super(PluginV2, self).update_network(context, id, network) self._invoke_device_plugins(self._func_name(), [context, id, @@ -134,7 +134,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): Deletes the network with the specified network identifier belonging to the specified tenant. """ - LOG.debug("delete_network() called\n") + LOG.debug(_("delete_network() called")) #We first need to check if there are any ports on this network with context.session.begin(): network = self._get_network(context, id) @@ -162,21 +162,21 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Gets a particular network """ - LOG.debug("get_network() called\n") + LOG.debug(_("get_network() called")) return super(PluginV2, self).get_network(context, id, fields) def get_networks(self, context, filters=None, fields=None): """ Gets all networks """ - LOG.debug("get_networks() called\n") + LOG.debug(_("get_networks() called")) return super(PluginV2, self).get_networks(context, filters, fields) def create_port(self, context, port): """ Creates a port on the specified Virtual Network. """ - LOG.debug("create_port() called\n") + LOG.debug(_("create_port() called")) new_port = super(PluginV2, self).create_port(context, port) try: self._invoke_device_plugins(self._func_name(), [context, new_port]) @@ -189,7 +189,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Deletes a port """ - LOG.debug("delete_port() called\n") + LOG.debug(_("delete_port() called")) port = self._get_port(context, id) """ TODO (Sumit): Disabling this check for now, check later @@ -212,7 +212,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Updates the state of a port and returns the updated port """ - LOG.debug("update_port() called\n") + LOG.debug(_("update_port() called")) try: self._invoke_device_plugins(self._func_name(), [context, id, port]) @@ -225,7 +225,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): Create a subnet, which represents a range of IP addresses that can be allocated to devices. """ - LOG.debug("create_subnet() called\n") + LOG.debug(_("create_subnet() called")) new_subnet = super(PluginV2, self).create_subnet(context, subnet) try: self._invoke_device_plugins(self._func_name(), [context, @@ -239,7 +239,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Updates the state of a subnet and returns the updated subnet """ - LOG.debug("update_subnet() called\n") + LOG.debug(_("update_subnet() called")) try: self._invoke_device_plugins(self._func_name(), [context, id, subnet]) @@ -251,7 +251,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Deletes a subnet """ - LOG.debug("delete_subnet() called\n") + LOG.debug(_("delete_subnet() called")) with context.session.begin(): subnet = self._get_subnet(context, id) # Check if ports are using this subnet @@ -277,7 +277,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ def get_all_portprofiles(self, tenant_id): """Get all port profiles""" - LOG.debug("get_all_portprofiles() called\n") + LOG.debug(_("get_all_portprofiles() called")) pplist = cdb.get_all_portprofiles() new_pplist = [] for portprofile in pplist: @@ -291,7 +291,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def get_portprofile_details(self, tenant_id, profile_id): """Get port profile details""" - LOG.debug("get_portprofile_details() called\n") + LOG.debug(_("get_portprofile_details() called")) try: portprofile = cdb.get_portprofile(tenant_id, profile_id) except Exception: @@ -306,7 +306,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def create_portprofile(self, tenant_id, profile_name, qos): """Create port profile""" - LOG.debug("create_portprofile() called\n") + LOG.debug(_("create_portprofile() called")) portprofile = cdb.add_portprofile(tenant_id, profile_name, const.NO_VLAN_ID, qos) new_pp = cutil.make_portprofile_dict(tenant_id, @@ -317,7 +317,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def delete_portprofile(self, tenant_id, profile_id): """Delete portprofile""" - LOG.debug("delete_portprofile() called\n") + LOG.debug(_("delete_portprofile() called")) try: portprofile = cdb.get_portprofile(tenant_id, profile_id) except Exception: @@ -333,7 +333,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def rename_portprofile(self, tenant_id, profile_id, new_name): """Rename port profile""" - LOG.debug("rename_portprofile() called\n") + LOG.debug(_("rename_portprofile() called")) try: portprofile = cdb.get_portprofile(tenant_id, profile_id) except Exception: @@ -349,7 +349,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def associate_portprofile(self, tenant_id, net_id, port_id, portprofile_id): """Associate port profile""" - LOG.debug("associate_portprofile() called\n") + LOG.debug(_("associate_portprofile() called")) try: portprofile = cdb.get_portprofile(tenant_id, portprofile_id) except Exception: @@ -361,7 +361,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def disassociate_portprofile(self, tenant_id, net_id, port_id, portprofile_id): """Disassociate port profile""" - LOG.debug("disassociate_portprofile() called\n") + LOG.debug(_("disassociate_portprofile() called")) try: portprofile = cdb.get_portprofile(tenant_id, portprofile_id) except Exception: @@ -372,13 +372,13 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def get_all_qoss(self, tenant_id): """Get all QoS levels""" - LOG.debug("get_all_qoss() called\n") + LOG.debug(_("get_all_qoss() called")) qoslist = cdb.get_all_qoss(tenant_id) return qoslist def get_qos_details(self, tenant_id, qos_id): """Get QoS Details""" - LOG.debug("get_qos_details() called\n") + LOG.debug(_("get_qos_details() called")) try: qos_level = cdb.get_qos(tenant_id, qos_id) except Exception: @@ -388,13 +388,13 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def create_qos(self, tenant_id, qos_name, qos_desc): """Create a QoS level""" - LOG.debug("create_qos() called\n") + LOG.debug(_("create_qos() called")) qos = cdb.add_qos(tenant_id, qos_name, str(qos_desc)) return qos def delete_qos(self, tenant_id, qos_id): """Delete a QoS level""" - LOG.debug("delete_qos() called\n") + LOG.debug(_("delete_qos() called")) try: qos_level = cdb.get_qos(tenant_id, qos_id) except Exception: @@ -404,7 +404,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def rename_qos(self, tenant_id, qos_id, new_name): """Rename QoS level""" - LOG.debug("rename_qos() called\n") + LOG.debug(_("rename_qos() called")) try: qos_level = cdb.get_qos(tenant_id, qos_id) except Exception: @@ -415,13 +415,13 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def get_all_credentials(self, tenant_id): """Get all credentials""" - LOG.debug("get_all_credentials() called\n") + LOG.debug(_("get_all_credentials() called")) credential_list = cdb.get_all_credentials(tenant_id) return credential_list def get_credential_details(self, tenant_id, credential_id): """Get a particular credential""" - LOG.debug("get_credential_details() called\n") + LOG.debug(_("get_credential_details() called")) try: credential = cdb.get_credential(tenant_id, credential_id) except Exception: @@ -432,14 +432,14 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def create_credential(self, tenant_id, credential_name, user_name, password): """Create a new credential""" - LOG.debug("create_credential() called\n") + LOG.debug(_("create_credential() called")) credential = cdb.add_credential(tenant_id, credential_name, user_name, password) return credential def delete_credential(self, tenant_id, credential_id): """Delete a credential""" - LOG.debug("delete_credential() called\n") + LOG.debug(_("delete_credential() called")) try: credential = cdb.get_credential(tenant_id, credential_id) except Exception: @@ -450,7 +450,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def rename_credential(self, tenant_id, credential_id, new_name): """Rename the particular credential resource""" - LOG.debug("rename_credential() called\n") + LOG.debug(_("rename_credential() called")) try: credential = cdb.get_credential(tenant_id, credential_id) except Exception: @@ -461,7 +461,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): def schedule_host(self, tenant_id, instance_id, instance_desc): """Provides the hostname on which a dynamic vnic is reserved""" - LOG.debug("schedule_host() called\n") + LOG.debug(_("schedule_host() called")) host_list = self._invoke_device_plugins(self._func_name(), [tenant_id, instance_id, @@ -472,7 +472,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Get the portprofile name and the device name for the dynamic vnic """ - LOG.debug("associate_port() called\n") + LOG.debug(_("associate_port() called")) return self._invoke_device_plugins(self._func_name(), [tenant_id, instance_id, instance_desc]) @@ -481,7 +481,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Remove the association of the VIF with the dynamic vnic """ - LOG.debug("detach_port() called\n") + LOG.debug(_("detach_port() called")) return self._invoke_device_plugins(self._func_name(), [tenant_id, instance_id, instance_desc]) @@ -490,7 +490,7 @@ class PluginV2(db_base_plugin_v2.QuantumDbPluginV2): """ Creates multiple ports on the specified Virtual Network. """ - LOG.debug("create_ports() called\n") + LOG.debug(_("create_ports() called")) ports_num = len(net_id_list) ports_id_list = [] ports_dict_list = [] diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py b/quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py index 0e10f025bd..ad8f61c4f1 100644 --- a/quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py +++ b/quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py @@ -78,7 +78,7 @@ class CiscoNEXUSDriver(): """ confstr = snipp.CMD_PORT_TRUNK % (interface) confstr = self.create_xml_snippet(confstr) - LOG.debug("NexusDriver: %s" % confstr) + LOG.debug(_("NexusDriver: %s"), confstr) mgr.edit_config(target='running', config=confstr) def disable_switch_port(self, mgr, interface): @@ -87,7 +87,7 @@ class CiscoNEXUSDriver(): """ confstr = snipp.CMD_NO_SWITCHPORT % (interface) confstr = self.create_xml_snippet(confstr) - LOG.debug("NexusDriver: %s" % confstr) + LOG.debug(_("NexusDriver: %s"), confstr) mgr.edit_config(target='running', config=confstr) def enable_vlan_on_trunk_int(self, mgr, interface, vlanid): @@ -97,7 +97,7 @@ class CiscoNEXUSDriver(): """ confstr = snipp.CMD_VLAN_INT_SNIPPET % (interface, vlanid) confstr = self.create_xml_snippet(confstr) - LOG.debug("NexusDriver: %s" % confstr) + LOG.debug(_("NexusDriver: %s"), confstr) mgr.edit_config(target='running', config=confstr) def disable_vlan_on_trunk_int(self, mgr, interface, vlanid): @@ -107,7 +107,7 @@ class CiscoNEXUSDriver(): """ confstr = snipp.CMD_NO_VLAN_INT_SNIPPET % (interface, vlanid) confstr = self.create_xml_snippet(confstr) - LOG.debug("NexusDriver: %s" % confstr) + LOG.debug(_("NexusDriver: %s"), confstr) mgr.edit_config(target='running', config=confstr) def create_vlan(self, vlan_name, vlan_id, nexus_host, nexus_user, @@ -122,7 +122,7 @@ class CiscoNEXUSDriver(): self.enable_vlan(man, vlan_id, vlan_name) if vlan_ids is '': vlan_ids = self.build_vlans_cmd() - LOG.debug("NexusDriver VLAN IDs: %s" % vlan_ids) + LOG.debug(_("NexusDriver VLAN IDs: %s"), vlan_ids) for ports in nexus_ports: self.enable_vlan_on_trunk_int(man, ports, vlan_ids) diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py b/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py index 57bc3c3a22..8ae780f914 100644 --- a/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py +++ b/quantum/plugins/cisco/nexus/cisco_nexus_plugin_v2.py @@ -48,7 +48,7 @@ class NexusPlugin(L2DevicePluginBase): Extracts the configuration parameters from the configuration file """ self._client = importutils.import_object(conf.NEXUS_DRIVER) - LOG.debug("Loaded driver %s\n" % conf.NEXUS_DRIVER) + LOG.debug(_("Loaded driver %s"), conf.NEXUS_DRIVER) self._nexus_switches = conf.NEXUS_DETAILS self.credentials = {} @@ -68,7 +68,7 @@ class NexusPlugin(L2DevicePluginBase): for the specified tenant. """ - LOG.debug("NexusPlugin:get_all_networks() called\n") + LOG.debug(_("NexusPlugin:get_all_networks() called")) return self._networks.values() def create_network(self, tenant_id, net_name, net_id, vlan_name, vlan_id, @@ -78,7 +78,7 @@ class NexusPlugin(L2DevicePluginBase): and configure the appropriate interfaces for this VLAN """ - LOG.debug("NexusPlugin:create_network() called\n") + LOG.debug(_("NexusPlugin:create_network() called")) # Grab the switch IP and port for this host switch_ip = '' port_id = '' @@ -131,13 +131,13 @@ class NexusPlugin(L2DevicePluginBase): Deletes the VLAN in all switches, and removes the VLAN configuration from the relevant interfaces """ - LOG.debug("NexusPlugin:delete_network() called\n") + LOG.debug(_("NexusPlugin:delete_network() called")) def get_network_details(self, tenant_id, net_id, **kwargs): """ Returns the details of a particular network """ - LOG.debug("NexusPlugin:get_network_details() called\n") + LOG.debug(_("NexusPlugin:get_network_details() called")) network = self._get_network(tenant_id, net_id) return network @@ -146,21 +146,21 @@ class NexusPlugin(L2DevicePluginBase): Updates the properties of a particular Virtual Network. """ - LOG.debug("NexusPlugin:update_network() called\n") + LOG.debug(_("NexusPlugin:update_network() called")) def get_all_ports(self, tenant_id, net_id, **kwargs): """ This is probably not applicable to the Nexus plugin. Delete if not required. """ - LOG.debug("NexusPlugin:get_all_ports() called\n") + LOG.debug(_("NexusPlugin:get_all_ports() called")) def create_port(self, tenant_id, net_id, port_state, port_id, **kwargs): """ This is probably not applicable to the Nexus plugin. Delete if not required. """ - LOG.debug("NexusPlugin:create_port() called\n") + LOG.debug(_("NexusPlugin:create_port() called")) def delete_port(self, device_id, vlan_id): """ @@ -168,7 +168,7 @@ class NexusPlugin(L2DevicePluginBase): whether the network is still required on the interfaces trunked """ - LOG.debug("NexusPlugin:delete_port() called\n") + LOG.debug(_("NexusPlugin:delete_port() called")) # Delete DB row for this port row = nxos_db.get_nexusvm_binding(vlan_id, device_id) if row: @@ -200,14 +200,14 @@ class NexusPlugin(L2DevicePluginBase): This is probably not applicable to the Nexus plugin. Delete if not required. """ - LOG.debug("NexusPlugin:update_port() called\n") + LOG.debug(_("NexusPlugin:update_port() called")) def get_port_details(self, tenant_id, net_id, port_id, **kwargs): """ This is probably not applicable to the Nexus plugin. Delete if not required. """ - LOG.debug("NexusPlugin:get_port_details() called\n") + LOG.debug(_("NexusPlugin:get_port_details() called")) def plug_interface(self, tenant_id, net_id, port_id, remote_interface_id, **kwargs): @@ -215,14 +215,14 @@ class NexusPlugin(L2DevicePluginBase): This is probably not applicable to the Nexus plugin. Delete if not required. """ - LOG.debug("NexusPlugin:plug_interface() called\n") + LOG.debug(_("NexusPlugin:plug_interface() called")) def unplug_interface(self, tenant_id, net_id, port_id, **kwargs): """ This is probably not applicable to the Nexus plugin. Delete if not required. """ - LOG.debug("NexusPlugin:unplug_interface() called\n") + LOG.debug(_("NexusPlugin:unplug_interface() called")) def _get_vlan_id_for_network(self, tenant_id, network_id, context, base_plugin_ref): diff --git a/quantum/plugins/cisco/services/service_insertion.py b/quantum/plugins/cisco/services/service_insertion.py index 19af73abfc..2abfd37844 100755 --- a/quantum/plugins/cisco/services/service_insertion.py +++ b/quantum/plugins/cisco/services/service_insertion.py @@ -53,7 +53,7 @@ def insert_inpath_service(tenant_id, service_image_id, management_net_name, northbound_net_name, southbound_net_name, *args): """Inserting a network service between two networks""" - print ("Creating Network for Services and Servers") + print _("Creating Network for Services and Servers") service_logic = servlogcs.ServicesLogistics() net_list = {} multiport_net_list = [] @@ -64,17 +64,18 @@ def insert_inpath_service(tenant_id, service_image_id, data = {servconts.NETWORK: {servconts.NAME: net}} net_list[net] = client.create_network(data) net_list[net][servconts.PORTS] = [] - LOG.debug("Network %s Created with ID: %s " % ( - net, net_list[net][servconts.NETWORK][servconts.ID])) - print "Completed" - print ("Creating Ports on Services and Server Networks") - LOG.debug("Operation 'create_port' executed.") + LOG.debug(_("Network %(net)s Created with ID: %(id)s "), + {'net': net, + 'id': net_list[net][servconts.NETWORK][servconts.ID]}) + print _("Completed") + print _("Creating Ports on Services and Server Networks") + LOG.debug(_("Operation 'create_port' executed.")) if not service_logic.verify_plugin(const.UCS_PLUGIN): for net in networks_name_list: net_list[net][servconts.PORTS].append (client.create_port (net_list[net][servconts.NETWORK][servconts.ID])) - LOG.debug("Operation 'create_port' executed.") + LOG.debug(_("Operation 'create_port' executed.")) else: for net in networks_name_list: nets = net_list[net][servconts.NETWORK][servconts.ID] @@ -84,28 +85,29 @@ def insert_inpath_service(tenant_id, service_image_id, for net in networks_name_list: port_id = data[servconts.PORTS][net_idx][servconts.ID] net_list[net][servconts.PORTS].append(port_id) - LOG.debug("Port UUID: %s on network: %s" % - (data[servconts.PORTS][net_idx][servconts.ID], net)) + LOG.debug(_("Port UUID: %(id)s on network: %(net)s"), + {'id': data[servconts.PORTS][net_idx][servconts.ID], + 'net': net}) net_idx = net_idx + 1 - print "Completed" + print _("Completed") try: create_vm_args = [] create_vm_args.append(servconts.CREATE_VM_CMD) create_vm_args.append(service_image_id) - print ("Creating VM with image: %s" % (service_image_id)) + print _("Creating VM with image: %s") % (service_image_id) process = utils.subprocess_popen(create_vm_args, stdout=subprocess.PIPE) result = process.stdout.readlines() tokens = re.search("i-[a-f0-9]*", str(result[1])) service_vm_name = tokens.group(0) - print ("Image: %s instantiated successfully" % (service_vm_name)) + print _("Image: %s instantiated successfully") % (service_vm_name) except Exception as exc: print exc service_logic.image_status(service_vm_name) - print "Completed" - print "Attaching Ports To VM Service interfaces" + print _("Completed") + print _("Attaching Ports To VM Service interfaces") try: idx = 0 for net in networks_name_list: @@ -113,17 +115,17 @@ def insert_inpath_service(tenant_id, service_image_id, port_id = net_list[net][servconts.PORTS][idx] attachment = client.show_port_attachment(network_id, port_id) attachment = attachment[servconts.ATTACHMENT][servconts.ID][:36] - LOG.debug(("Plugging virtual interface: %s of VM %s" - "into port: %s on network: %s") % - (attachment, service_vm_name, port_id, net)) + LOG.debug(_("Plugging virtual interface: %(attachment)s of VM " + "%(service_vm_name)s into port: %(port_id)s on " + "network: %(net)s"), locals()) attach_data = {servconts.ATTACHMENT: {servconts.ID: '%s' % attachment}} client.attach_resource(network_id, port_id, attach_data) except Exception as exc: print exc - print "Completed" + print _("Completed") try: - LOG.debug("Registering Service in DB") + LOG.debug(_("Registering Service in DB")) l2db.initialize() for uuid_net in db.network_id(networks_name_list[0]): mngnet_id = str(uuid_net.uuid) @@ -142,14 +144,14 @@ def delete_service(tenant_id, service_instance_id, *args): Removes a service and all the network configuration """ l2db.initialize() - print ("Terminating Service VM") + print _("Terminating Service VM") service_logic = servlogcs.ServicesLogistics() vms_list = [] vms_list.append(servconts.DELETE_VM_CMD) vms_list.append(service_instance_id) if not service_logic.image_exist(service_instance_id): - print ("Service VM does not exist") + print _("Service VM does not exist") sys.exit() result = subprocess.call(vms_list) @@ -157,7 +159,7 @@ def delete_service(tenant_id, service_instance_id, *args): client = Client(HOST, PORT, USE_SSL, format='json', tenant=tenant_id) service_nets = sdb.get_service_bindings(service_instance_id) - print ("Terminating Ports and Networks") + print _("Terminating Ports and Networks") network_name = db.network_get(service_nets.mngnet_id) port_id_net = db.port_list(service_nets.mngnet_id) for ports_uuid in port_id_net: @@ -174,7 +176,7 @@ def delete_service(tenant_id, service_instance_id, *args): client.delete_port(service_nets.sbnet_id, ports_uuid.uuid) client.delete_network(service_nets.sbnet_id) service_list = sdb.remove_services_binding(service_instance_id) - print ("Configuration Removed Successfully") + print _("Configuration Removed Successfully") def disconnect_vm(vm_instance_id, *args): @@ -182,14 +184,14 @@ def disconnect_vm(vm_instance_id, *args): Deletes VMs and Port connection """ l2db.initialize() - print ("Terminating Service VM") + print _("Terminating Service VM") service_logic = servlogcs.ServicesLogistics() vms_list = [] vms_list.append(servconts.DELETE_VM_CMD) vms_list.append(vm_instance_id) result = subprocess.call(vms_list) service_logic.image_shutdown_verification(vm_instance_id) - print ("VM Server Off") + print _("VM Server Off") def connect_vm(tenant_id, vm_image_id, service_instance_id, *args): @@ -198,40 +200,44 @@ def connect_vm(tenant_id, vm_image_id, service_instance_id, *args): """ l2db.initialize() client = Client(HOST, PORT, USE_SSL, format='json', tenant=tenant_id) - print ("Connecting %s to Service %s " % (vm_image_id, service_instance_id)) + print (_("Connecting %(vm_image_id)s to Service " + "%(service_instance_id)s") % locals()) service_logic = servlogcs.ServicesLogistics() service_nets = sdb.get_service_bindings(service_instance_id) client.create_port(service_nets.mngnet_id) client.create_port(service_nets.nbnet_id) sb_port_id = client.create_port(service_nets.sbnet_id) - LOG.debug("Operation 'create_port' executed.") + LOG.debug(_("Operation 'create_port' executed.")) new_port_id = sb_port_id[servconts.PORT][servconts.ID] try: create_vm_args = [] create_vm_args.append(servconts.CREATE_VM_CMD) create_vm_args.append(vm_image_id) - print ("Creating VM with image: %s" % (vm_image_id)) + print _("Creating VM with image: %s") % (vm_image_id) process = utils.subprocess_popen(create_vm_args, stdout=subprocess.PIPE) result = process.stdout.readlines() tokens = re.search("i-[a-f0-9]*", str(result[1])) vm_name = tokens.group(0) - print ("Image: %s instantiated successfully" % (vm_name)) + print _("Image: %s instantiated successfully") % (vm_name) except Exception as exc: print exc service_logic.image_status(vm_name) - print "Completed" - print "Attaching Ports To VM Service interfaces" + print _("Completed") + print _("Attaching Ports To VM Service interfaces") south_net = service_nets.sbnet_id attachment = client.show_port_attachment(south_net, new_port_id) attachment = attachment[servconts.ATTACHMENT][servconts.ID][:36] - LOG.debug(("Plugging virtual interface: %s of VM %s " - "into port: %s on network: %s") % - (attachment, vm_name, new_port_id, service_nets.sbnet_id)) + LOG.debug(_("Plugging virtual interface: %(attachment)s of VM " + "%(vm_name)s into port: %(new_port_id)s on network: " + "%(sbnet_id)s"), {'attachment': attachment, + 'vm_name': vm_name, + 'new_port_id': new_port_id, + 'sbnet_id': service_nets.sbnet_id}) attach_data = {servconts.ATTACHMENT: {servconts.ID: '%s' % attachment}} client.attach_resource(service_nets.sbnet_id, new_port_id, attach_data) - print ("Connect VM Ended") + print _("Connect VM Ended") def create_multiport(tenant_id, networks_list, *args): @@ -256,16 +262,24 @@ def build_args(cmd, cmdargs, arglist): args.append(arglist[0]) del arglist[0] except: - LOG.debug("Not enough arguments for \"%s\" (expected: %d, got: %d)" % - (cmd, len(cmdargs), len(orig_arglist))) - print "Service Insertion Usage:\n %s %s" % ( - cmd, " ".join(["<%s>" % y for y in SERVICE_COMMANDS[cmd]["args"]])) + LOG.debug(_("Not enough arguments for '%(cmd)s' " + "(expected: %(len_cmd)d, got: %(len_args)d)", + {'cmd': cmd, 'len_cmd': len(cmdargs), + 'len_args': len(orig_arglist)})) + print (_("Service Insertion Usage:\n %(cmd)s %(usage)s") % + {'cmd': cmd, + 'usage': " ".join(["<%s>" % y + for y in SERVICE_COMMANDS[cmd]["args"]])}) sys.exit() if len(arglist) > 0: - LOG.debug("Too many arguments for \"%s\" (expected: %d, got: %d)" - % (cmd, len(cmdargs), len(orig_arglist))) - print "Service Insertion Usage:\n %s %s" % ( - cmd, " ".join(["<%s>" % y for y in SERVICE_COMMANDS[cmd]["args"]])) + LOG.debug(_("Too many arguments for '%(cmd)s' (expected: %(len)d, " + "got: %(len_args)d)"), + {'cmd': cmd, 'len_cmd': len(cmdargs), + 'len_args': len(orig_arglist)}) + print (_("Service Insertion Usage:\n %(cmd)s %(usage)s") % + {'cmd': cmd, + 'usage': " ".join(["<%s>" % y + for y in SERVICE_COMMANDS[cmd]["args"]])}) sys.exit() return args @@ -293,20 +307,21 @@ SERVICE_COMMANDS = { if __name__ == "__main__": os.system("clear") - usagestr = "Usage: %prog [OPTIONS] [args]" + usagestr = _("Usage: %prog [OPTIONS] [args]") PARSER = OptionParser(usage=usagestr) PARSER.add_option("-H", "--host", dest="host", type="string", default="127.0.0.1", - help="ip address of api host") + help=_("IP address of api host")) PARSER.add_option("-p", "--port", dest="port", - type="int", default=9696, help="api port") + type="int", default=9696, help=_("Api port")) PARSER.add_option("-s", "--ssl", dest="ssl", - action="store_true", default=False, help="use ssl") + action="store_true", default=False, help=_("Use ssl")) PARSER.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False, - help="turn on verbose logging") + help=_("Turn on verbose logging")) PARSER.add_option("-f", "--logfile", dest="logfile", - type="string", default="syslog", help="log file path") + type="string", default="syslog", + help=_("Log file path")) options, args = PARSER.parse_args() if options.verbose: LOG.setLevel(logging.DEBUG) diff --git a/quantum/plugins/cisco/services/services_logistics.py b/quantum/plugins/cisco/services/services_logistics.py index d8bf7651d1..57f8fc8e94 100644 --- a/quantum/plugins/cisco/services/services_logistics.py +++ b/quantum/plugins/cisco/services/services_logistics.py @@ -110,15 +110,15 @@ class ServicesLogistics(): plugin_obj = conf.PLUGINS[const.PLUGINS][key] _plugins[key] = importutils.import_object(plugin_obj) if not plugin_key in _plugins.keys(): - LOG.debug("No %s Plugin loaded" % plugin_key) + LOG.debug(_("No %s Plugin loaded"), plugin_key) return False else: - LOG.debug("Plugin %s founded" % const.UCS_PLUGIN) + LOG.debug(_("Plugin %s founded"), const.UCS_PLUGIN) return True def press_key(self): """ Waits for en external input """ - key = raw_input("Press any key to continue") + key = raw_input(_("Press any key to continue")) return key diff --git a/quantum/plugins/cisco/ucs/cisco_ucs_inventory_v2.py b/quantum/plugins/cisco/ucs/cisco_ucs_inventory_v2.py index 19cb9aca28..ac757e56c0 100644 --- a/quantum/plugins/cisco/ucs/cisco_ucs_inventory_v2.py +++ b/quantum/plugins/cisco/ucs/cisco_ucs_inventory_v2.py @@ -97,8 +97,8 @@ class UCSInventory(L2NetworkDeviceInventoryBase): def _load_inventory(self): """Load the inventory from a config file""" inventory = deepcopy(conf.INVENTORY) - LOG.info("Loaded UCS inventory: %s\n" % inventory) - LOG.info("Building UCS inventory state (this may take a while)...") + LOG.info(_("Loaded UCS inventory: %s"), inventory) + LOG.info(_("Building UCS inventory state (this may take a while)...")) for ucsm in inventory.keys(): ucsm_ip = inventory[ucsm][const.IP_ADDRESS] @@ -141,7 +141,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): ucsm_password) blades_dict[blade_id] = blade_data - LOG.debug("UCS Inventory state is: %s\n" % self._inventory_state) + LOG.debug(_("UCS Inventory state is: %s"), self._inventory_state) return True def _get_host_name(self, ucsm_ip, chassis_id, blade_id): @@ -285,7 +285,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): udb.update_portbinding(port_id, instance_id=instance_id) return host_name - LOG.warn("Could not find a reserved dynamic nic for tenant: %s" % + LOG.warn(_("Could not find a reserved dynamic nic for tenant: %s"), tenant_id) return None @@ -307,9 +307,10 @@ class UCSInventory(L2NetworkDeviceInventoryBase): intf_data[const.TENANTID] == tenant_id and intf_data[const.INSTANCE_ID] == instance_id): found_blade_intf_data = blade_intf_data - LOG.debug(("Found blade %s associated with this" - " instance: %s") % (blade_id, - instance_id)) + LOG.debug(_("Found blade %(blade_id)s " + "associated with this" + " instance: %(instance_id)s"), + locals()) break if found_blade_intf_data: @@ -332,14 +333,13 @@ class UCSInventory(L2NetworkDeviceInventoryBase): const.DEVICENAME: device_name, const.UCSPROFILE: profile_name, } - LOG.debug(("Found reserved dynamic nic: %s" - "associated with port %s") % - (intf_data, port_id)) - LOG.debug("Returning dynamic nic details: %s" % + LOG.debug(_("Found reserved dynamic nic: %(intf_data)s" + "associated with port %(port_id)s"), locals()) + LOG.debug(_("Returning dynamic nic details: %s"), dynamicnic_details) return dynamicnic_details - LOG.warn("Could not find a reserved dynamic nic for tenant: %s" % + LOG.warn(_("Could not find a reserved dynamic nic for tenant: %s"), tenant_id) return None @@ -370,15 +370,15 @@ class UCSInventory(L2NetworkDeviceInventoryBase): udb.update_portbinding(port_id, instance_id=None, vif_id=None) LOG.debug( - ("Disassociated VIF-ID: %s " - "from port: %s" - "in UCS inventory state for blade: %s") % - (vif_id, port_id, intf_data)) + _("Disassociated VIF-ID: %(vif_id)s " + "from port: %(port_id)s" + "in UCS inventory state for blade: " + "%(intf_data)s"), locals()) device_params = {const.DEVICE_IP: [ucsm_ip], const.PORTID: port_id} return device_params - LOG.warn(("Disassociating VIF-ID in UCS inventory failed. " - "Could not find a reserved dynamic nic for tenant: %s") % + LOG.warn(_("Disassociating VIF-ID in UCS inventory failed. " + "Could not find a reserved dynamic nic for tenant: %s"), tenant_id) return None @@ -409,8 +409,8 @@ class UCSInventory(L2NetworkDeviceInventoryBase): const.BLADE_INTF_DN: interface_dn} return blade_intf_info - LOG.warn("Could not find a reserved nic for tenant: %s port: %s" % - (tenant_id, port_id)) + LOG.warn(_("Could not find a reserved nic for tenant: %(tenant_id)s " + "port: %(port_id)s"), locals()) return None def _get_least_reserved_blade(self, intf_count=1): @@ -436,9 +436,9 @@ class UCSInventory(L2NetworkDeviceInventoryBase): least_reserved_blade_data = blade_data if unreserved_interface_count < intf_count: - LOG.warn(("Not enough dynamic nics available on a single host." - " Requested: %s, Maximum available: %s") % - (intf_count, unreserved_interface_count)) + LOG.warn(_("Not enough dynamic nics available on a single host." + " Requested: %(intf_count)s, Maximum available: " + "%(unreserved_interface_count)s"), locals()) return False least_reserved_blade_dict = { @@ -447,7 +447,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): const.LEAST_RSVD_BLADE_ID: least_reserved_blade_id, const.LEAST_RSVD_BLADE_DATA: least_reserved_blade_data, } - LOG.debug("Found dynamic nic %s available for reservation", + LOG.debug(_("Found dynamic nic %s available for reservation"), least_reserved_blade_dict) return least_reserved_blade_dict @@ -520,11 +520,12 @@ class UCSInventory(L2NetworkDeviceInventoryBase): None, None, None) udb.update_portbinding(port_id, tenant_id=intf_data[const.TENANTID]) - LOG.debug("Reserved blade interface: %s\n" % reserved_nic_dict) + LOG.debug(_("Reserved blade interface: %s"), + reserved_nic_dict) return reserved_nic_dict - LOG.warn("Dynamic nic %s could not be reserved for port-id: %s" % - (blade_data, port_id)) + LOG.warn(_("Dynamic nic %(blade_data)s could not be reserved for " + "port-id: %(port_id)s"), locals()) return False def unreserve_blade_interface(self, ucsm_ip, chassis_id, blade_id, @@ -542,7 +543,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): blade_intf[const.PROFILE_ID] = None blade_intf[const.INSTANCE_ID] = None blade_intf[const.VIF_ID] = None - LOG.debug("Unreserved blade interface %s\n" % interface_dn) + LOG.debug(_("Unreserved blade interface %s"), interface_dn) def add_blade(self, ucsm_ip, chassis_id, blade_id): """Add a blade to the inventory""" @@ -551,32 +552,32 @@ class UCSInventory(L2NetworkDeviceInventoryBase): def get_all_networks(self, args): """Return all UCSM IPs""" - LOG.debug("get_all_networks() called\n") + LOG.debug(_("get_all_networks() called")) return self._get_all_ucsms() def create_network(self, args): """Return all UCSM IPs""" - LOG.debug("create_network() called\n") + LOG.debug(_("create_network() called")) return self._get_all_ucsms() def delete_network(self, args): """Return all UCSM IPs""" - LOG.debug("delete_network() called\n") + LOG.debug(_("delete_network() called")) return self._get_all_ucsms() def get_network_details(self, args): """Return all UCSM IPs""" - LOG.debug("get_network_details() called\n") + LOG.debug(_("get_network_details() called")) return self._get_all_ucsms() def update_network(self, args): """Return all UCSM IPs""" - LOG.debug("update_network() called\n") + LOG.debug(_("update_network() called")) return self._get_all_ucsms() def get_all_ports(self, args): """Return all UCSM IPs""" - LOG.debug("get_all_ports() called\n") + LOG.debug(_("get_all_ports() called")) return self._get_all_ucsms() def create_port(self, args): @@ -584,7 +585,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Return the a dict with information of the blade on which a dynamic vnic is available """ - LOG.debug("create_port() called\n") + LOG.debug(_("create_port() called")) least_reserved_blade_dict = self._get_least_reserved_blade() if not least_reserved_blade_dict: raise cexc.NoMoreNics() @@ -601,14 +602,14 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Return the a dict with information of the blade on which a dynamic vnic was reserved for this port """ - LOG.debug("delete_port() called\n") + LOG.debug(_("delete_port() called")) tenant_id = args[0] net_id = args[1] port_id = args[2] rsvd_info = self._get_rsvd_blade_intf_by_port(tenant_id, port_id) if not rsvd_info: - LOG.warn("UCSInventory: Port not found: net_id: %s, port_id: %s" % - (net_id, port_id)) + LOG.warn(_("UCSInventory: Port not found: net_id: %(net_id)s, " + "port_id: %(port_id)s"), locals()) return {const.DEVICE_IP: []} device_params = { const.DEVICE_IP: [rsvd_info[const.UCSM_IP]], @@ -624,7 +625,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Return the a dict with IP address of the blade on which a dynamic vnic was reserved for this port """ - LOG.debug("update_port() called\n") + LOG.debug(_("update_port() called")) return self._get_blade_for_port(args) def get_port_details(self, args): @@ -632,7 +633,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Return the a dict with IP address of the blade on which a dynamic vnic was reserved for this port """ - LOG.debug("get_port_details() called\n") + LOG.debug(_("get_port_details() called")) return self._get_blade_for_port(args) def plug_interface(self, args): @@ -640,7 +641,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Return the a dict with IP address of the blade on which a dynamic vnic was reserved for this port """ - LOG.debug("plug_interface() called\n") + LOG.debug(_("plug_interface() called")) return self._get_blade_for_port(args) def unplug_interface(self, args): @@ -648,31 +649,31 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Return the a dict with IP address of the blade on which a dynamic vnic was reserved for this port """ - LOG.debug("unplug_interface() called\n") + LOG.debug(_("unplug_interface() called")) return self._get_blade_for_port(args) def schedule_host(self, args): """Provides the hostname on which a dynamic vnic is reserved""" - LOG.debug("schedule_host() called\n") + LOG.debug(_("schedule_host() called")) instance_id = args[1] tenant_id = args[2][const.PROJECT_ID] host_name = self._get_host_name_for_rsvd_intf(tenant_id, instance_id) host_list = {const.HOST_LIST: {const.HOST_1: host_name}} - LOG.debug("host_list is: %s" % host_list) + LOG.debug(_("host_list is: %s"), host_list) return host_list def associate_port(self, args): """ Get the portprofile name and the device name for the dynamic vnic """ - LOG.debug("associate_port() called\n") + LOG.debug(_("associate_port() called")) instance_id = args[1] tenant_id = args[2][const.PROJECT_ID] vif_id = args[2][const.VIF_ID] vif_info = self._get_instance_port(tenant_id, instance_id, vif_id) vif_desc = {const.VIF_DESC: vif_info} - LOG.debug("vif_desc is: %s" % vif_desc) + LOG.debug(_("vif_desc is: %s"), vif_desc) return vif_desc def detach_port(self, args): @@ -680,7 +681,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): Remove the VIF-ID and instance name association with the port """ - LOG.debug("detach_port() called\n") + LOG.debug(_("detach_port() called")) instance_id = args[1] tenant_id = args[2][const.PROJECT_ID] vif_id = args[2][const.VIF_ID] @@ -693,7 +694,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): """ Create multiple ports for a VM """ - LOG.debug("create_ports() called\n") + LOG.debug(_("create_ports() called")) tenant_id = args[0] ports_num = args[2] least_reserved_blade_dict = self._get_least_reserved_blade(ports_num) diff --git a/quantum/plugins/cisco/ucs/cisco_ucs_plugin_v2.py b/quantum/plugins/cisco/ucs/cisco_ucs_plugin_v2.py index 0de87e70c8..16c1c19b41 100644 --- a/quantum/plugins/cisco/ucs/cisco_ucs_plugin_v2.py +++ b/quantum/plugins/cisco/ucs/cisco_ucs_plugin_v2.py @@ -40,7 +40,7 @@ class UCSVICPlugin(L2DevicePluginBase): def __init__(self): self._driver = importutils.import_object(conf.UCSM_DRIVER) - LOG.debug("Loaded driver %s\n" % conf.UCSM_DRIVER) + LOG.debug(_("Loaded driver %s"), conf.UCSM_DRIVER) # TODO (Sumit) Make the counter per UCSM self._port_profile_counter = 0 @@ -50,7 +50,7 @@ class UCSVICPlugin(L2DevicePluginBase): for the specified tenant. """ - LOG.debug("UCSVICPlugin:get_all_networks() called\n") + LOG.debug(_("UCSVICPlugin:get_all_networks() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) networks_list = db.network_list(tenant_id) new_networks_list = [] @@ -68,7 +68,7 @@ class UCSVICPlugin(L2DevicePluginBase): Creates a new Virtual Network, and assigns it a symbolic name. """ - LOG.debug("UCSVICPlugin:create_network() called\n") + LOG.debug(_("UCSVICPlugin:create_network() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) self._driver.create_vlan(vlan_name, str(vlan_id), self._ucsm_ip, self._ucsm_username, self._ucsm_password) @@ -83,7 +83,7 @@ class UCSVICPlugin(L2DevicePluginBase): Deletes the network with the specified network identifier belonging to the specified tenant. """ - LOG.debug("UCSVICPlugin:delete_network() called\n") + LOG.debug(_("UCSVICPlugin:delete_network() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) vlan_binding = cdb.get_vlan_binding(net_id) vlan_name = vlan_binding[const.VLANNAME] @@ -100,7 +100,7 @@ class UCSVICPlugin(L2DevicePluginBase): Deletes the Virtual Network belonging to a the spec """ - LOG.debug("UCSVICPlugin:get_network_details() called\n") + LOG.debug(_("UCSVICPlugin:get_network_details() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) network = db.network_get(net_id) ports_list = network[const.NETWORKPORTS] @@ -123,7 +123,7 @@ class UCSVICPlugin(L2DevicePluginBase): Updates the symbolic name belonging to a particular Virtual Network. """ - LOG.debug("UCSVICPlugin:update_network() called\n") + LOG.debug(_("UCSVICPlugin:update_network() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) network = db.network_get(net_id) net_dict = cutil.make_net_dict(network[const.UUID], @@ -136,7 +136,7 @@ class UCSVICPlugin(L2DevicePluginBase): Retrieves all port identifiers belonging to the specified Virtual Network. """ - LOG.debug("UCSVICPlugin:get_all_ports() called\n") + LOG.debug(_("UCSVICPlugin:get_all_ports() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) network = db.network_get(net_id) ports_list = network[const.NETWORKPORTS] @@ -151,7 +151,7 @@ class UCSVICPlugin(L2DevicePluginBase): """ Creates a port on the specified Virtual Network. """ - LOG.debug("UCSVICPlugin:create_port() called\n") + LOG.debug(_("UCSVICPlugin:create_port() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) qos = None ucs_inventory = kwargs[const.UCS_INVENTORY] @@ -183,7 +183,7 @@ class UCSVICPlugin(L2DevicePluginBase): the remote interface should first be un-plugged and then the port can be deleted. """ - LOG.debug("UCSVICPlugin:delete_port() called\n") + LOG.debug(_("UCSVICPlugin:delete_port() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) ucs_inventory = kwargs[const.UCS_INVENTORY] chassis_id = kwargs[const.CHASSIS_ID] @@ -200,7 +200,7 @@ class UCSVICPlugin(L2DevicePluginBase): """ Updates the state of a port on the specified Virtual Network. """ - LOG.debug("UCSVICPlugin:update_port() called\n") + LOG.debug(_("UCSVICPlugin:update_port() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) pass @@ -209,7 +209,7 @@ class UCSVICPlugin(L2DevicePluginBase): This method allows the user to retrieve a remote interface that is attached to this particular port. """ - LOG.debug("UCSVICPlugin:get_port_details() called\n") + LOG.debug(_("UCSVICPlugin:get_port_details() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) port_binding = udb.get_portbinding(port_id) return port_binding @@ -220,7 +220,7 @@ class UCSVICPlugin(L2DevicePluginBase): Attaches a remote interface to the specified port on the specified Virtual Network. """ - LOG.debug("UCSVICPlugin:plug_interface() called\n") + LOG.debug(_("UCSVICPlugin:plug_interface() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) port_binding = udb.get_portbinding(port_id) profile_name = port_binding[const.PORTPROFILENAME] @@ -239,7 +239,7 @@ class UCSVICPlugin(L2DevicePluginBase): Detaches a remote interface from the specified port on the specified Virtual Network. """ - LOG.debug("UCSVICPlugin:unplug_interface() called\n") + LOG.debug(_("UCSVICPlugin:unplug_interface() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) port_binding = udb.get_portbinding(port_id) profile_name = port_binding[const.PORTPROFILENAME] @@ -257,7 +257,7 @@ class UCSVICPlugin(L2DevicePluginBase): """ Creates a port on the specified Virtual Network. """ - LOG.debug("UCSVICPlugin:create_multiport() called\n") + LOG.debug(_("UCSVICPlugin:create_multiport() called")) self._set_ucsm(kwargs[const.DEVICE_IP]) qos = None ucs_inventory = kwargs[const.UCS_INVENTORY] @@ -290,7 +290,7 @@ class UCSVICPlugin(L2DevicePluginBase): """ Remove the association of the VIF with the dynamic vnic """ - LOG.debug("detach_port() called\n") + LOG.debug(_("detach_port() called")) port_id = kwargs[const.PORTID] kwargs.pop(const.PORTID) return self.unplug_interface(tenant_id, None, port_id, **kwargs)