summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-05 00:47:56 +0000
committerGerrit Code Review <review@openstack.org>2019-01-05 00:47:56 +0000
commita8daa9540c594b7b4317158e5aa555b8a2afc04f (patch)
tree0083213b880abfa7e814c29ae91bdf5a773d4b68
parent70b92620fff3fb56cd75e76fdd68103930f6f74b (diff)
parent2117632c50a676a1782bdbd731b4d02f36a6f047 (diff)
Merge "Improve service instance module debug logging"
-rw-r--r--manila/network/linux/interface.py4
-rw-r--r--manila/share/drivers/generic.py2
-rw-r--r--manila/share/drivers/service_instance.py6
-rw-r--r--manila/utils.py3
4 files changed, 13 insertions, 2 deletions
diff --git a/manila/network/linux/interface.py b/manila/network/linux/interface.py
index b5a7f80..03d580c 100644
--- a/manila/network/linux/interface.py
+++ b/manila/network/linux/interface.py
@@ -143,7 +143,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
143 143
144 if not ip_lib.device_exists(device_name, 144 if not ip_lib.device_exists(device_name,
145 namespace=namespace): 145 namespace=namespace):
146 146 LOG.info("Device %s does not exist - creating ....", device_name)
147 tap_name = self._get_tap_name(device_name) 147 tap_name = self._get_tap_name(device_name)
148 self._ovs_add_port(bridge, tap_name, port_id, mac_address) 148 self._ovs_add_port(bridge, tap_name, port_id, mac_address)
149 ns_dev.link.set_address(mac_address) 149 ns_dev.link.set_address(mac_address)
@@ -154,7 +154,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
154 namespace_obj.add_device_to_namespace(ns_dev) 154 namespace_obj.add_device_to_namespace(ns_dev)
155 155
156 else: 156 else:
157 LOG.warning("Device %s already exists.", device_name) 157 LOG.info("Device %s already exists.", device_name)
158 if ns_dev.link.address != mac_address: 158 if ns_dev.link.address != mac_address:
159 LOG.warning("Reset mac address to %s", mac_address) 159 LOG.warning("Reset mac address to %s", mac_address)
160 ns_dev.link.set_address(mac_address) 160 ns_dev.link.set_address(mac_address)
diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py
index 949599d..e2bcd8f 100644
--- a/manila/share/drivers/generic.py
+++ b/manila/share/drivers/generic.py
@@ -141,6 +141,8 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver):
141 driver_config=self.configuration)) 141 driver_config=self.configuration))
142 142
143 def _ssh_exec(self, server, command, check_exit_code=True): 143 def _ssh_exec(self, server, command, check_exit_code=True):
144 LOG.debug("_ssh_exec - server: %s, command: %s, check_exit_code: %s",
145 server, command, check_exit_code)
144 connection = self.ssh_connections.get(server['instance_id']) 146 connection = self.ssh_connections.get(server['instance_id'])
145 ssh_conn_timeout = self.configuration.ssh_conn_timeout 147 ssh_conn_timeout = self.configuration.ssh_conn_timeout
146 if not connection: 148 if not connection:
diff --git a/manila/share/drivers/service_instance.py b/manila/share/drivers/service_instance.py
index 0369173..6d4347b 100644
--- a/manila/share/drivers/service_instance.py
+++ b/manila/share/drivers/service_instance.py
@@ -949,6 +949,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
949 and setting up required network devices. 949 and setting up required network devices.
950 """ 950 """
951 if self.use_service_network: 951 if self.use_service_network:
952 LOG.debug("Plugging service instance into service network %s.",
953 self.service_network_id)
952 port = self._get_service_port( 954 port = self._get_service_port(
953 self.service_network_id, None, 'manila-share') 955 self.service_network_id, None, 'manila-share')
954 port = self._add_fixed_ips_to_service_port(port) 956 port = self._add_fixed_ips_to_service_port(port)
@@ -957,6 +959,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
957 self._plug_interface_in_host(interface_name, device, port) 959 self._plug_interface_in_host(interface_name, device, port)
958 960
959 if self.use_admin_port: 961 if self.use_admin_port:
962 LOG.debug("Plugging service instance into admin network %s.",
963 self.admin_network_id)
960 port = self._get_service_port( 964 port = self._get_service_port(
961 self.admin_network_id, self.admin_subnet_id, 965 self.admin_network_id, self.admin_subnet_id,
962 'manila-admin-share') 966 'manila-admin-share')
@@ -971,6 +975,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
971 external=True) 975 external=True)
972 def _plug_interface_in_host(self, interface_name, device, port): 976 def _plug_interface_in_host(self, interface_name, device, port):
973 977
978 LOG.debug("Plug interface into host - interface_name: %s, "
979 "device: %s, port: %s", interface_name, device, port)
974 self.vif_driver.plug(interface_name, port['id'], port['mac_address']) 980 self.vif_driver.plug(interface_name, port['id'], port['mac_address'])
975 ip_cidrs = [] 981 ip_cidrs = []
976 for fixed_ip in port['fixed_ips']: 982 for fixed_ip in port['fixed_ips']:
diff --git a/manila/utils.py b/manila/utils.py
index 1a38a4a..05792db 100644
--- a/manila/utils.py
+++ b/manila/utils.py
@@ -30,6 +30,7 @@ import tempfile
30import time 30import time
31 31
32from eventlet import pools 32from eventlet import pools
33import logging
33import netaddr 34import netaddr
34from oslo_concurrency import lockutils 35from oslo_concurrency import lockutils
35from oslo_concurrency import processutils 36from oslo_concurrency import processutils
@@ -93,6 +94,8 @@ def execute(*cmd, **kwargs):
93 """Convenience wrapper around oslo's execute() function.""" 94 """Convenience wrapper around oslo's execute() function."""
94 if 'run_as_root' in kwargs and 'root_helper' not in kwargs: 95 if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
95 kwargs['root_helper'] = _get_root_helper() 96 kwargs['root_helper'] = _get_root_helper()
97 if hasattr('CONF', 'debug') and CONF.debug:
98 kwargs['loglevel'] = logging.DEBUG
96 return processutils.execute(*cmd, **kwargs) 99 return processutils.execute(*cmd, **kwargs)
97 100
98 101