Browse Source

Merge "Improve service instance module debug logging"

Zuul 3 months ago
parent
commit
a8daa9540c

+ 2
- 2
manila/network/linux/interface.py View File

@@ -143,7 +143,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
143 143
 
144 144
         if not ip_lib.device_exists(device_name,
145 145
                                     namespace=namespace):
146
-
146
+            LOG.info("Device %s does not exist - creating ....", device_name)
147 147
             tap_name = self._get_tap_name(device_name)
148 148
             self._ovs_add_port(bridge, tap_name, port_id, mac_address)
149 149
             ns_dev.link.set_address(mac_address)
@@ -154,7 +154,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
154 154
                 namespace_obj.add_device_to_namespace(ns_dev)
155 155
 
156 156
         else:
157
-            LOG.warning("Device %s already exists.", device_name)
157
+            LOG.info("Device %s already exists.", device_name)
158 158
             if ns_dev.link.address != mac_address:
159 159
                 LOG.warning("Reset mac address to %s", mac_address)
160 160
                 ns_dev.link.set_address(mac_address)

+ 2
- 0
manila/share/drivers/generic.py View File

@@ -141,6 +141,8 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver):
141 141
                 driver_config=self.configuration))
142 142
 
143 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 146
         connection = self.ssh_connections.get(server['instance_id'])
145 147
         ssh_conn_timeout = self.configuration.ssh_conn_timeout
146 148
         if not connection:

+ 6
- 0
manila/share/drivers/service_instance.py View File

@@ -949,6 +949,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
949 949
         and setting up required network devices.
950 950
         """
951 951
         if self.use_service_network:
952
+            LOG.debug("Plugging service instance into service network %s.",
953
+                      self.service_network_id)
952 954
             port = self._get_service_port(
953 955
                 self.service_network_id, None, 'manila-share')
954 956
             port = self._add_fixed_ips_to_service_port(port)
@@ -957,6 +959,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
957 959
             self._plug_interface_in_host(interface_name, device, port)
958 960
 
959 961
         if self.use_admin_port:
962
+            LOG.debug("Plugging service instance into admin network %s.",
963
+                      self.admin_network_id)
960 964
             port = self._get_service_port(
961 965
                 self.admin_network_id, self.admin_subnet_id,
962 966
                 'manila-admin-share')
@@ -971,6 +975,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
971 975
                         external=True)
972 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 980
         self.vif_driver.plug(interface_name, port['id'], port['mac_address'])
975 981
         ip_cidrs = []
976 982
         for fixed_ip in port['fixed_ips']:

+ 3
- 0
manila/utils.py View File

@@ -30,6 +30,7 @@ import tempfile
30 30
 import time
31 31
 
32 32
 from eventlet import pools
33
+import logging
33 34
 import netaddr
34 35
 from oslo_concurrency import lockutils
35 36
 from oslo_concurrency import processutils
@@ -93,6 +94,8 @@ def execute(*cmd, **kwargs):
93 94
     """Convenience wrapper around oslo's execute() function."""
94 95
     if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
95 96
         kwargs['root_helper'] = _get_root_helper()
97
+    if hasattr('CONF', 'debug') and CONF.debug:
98
+        kwargs['loglevel'] = logging.DEBUG
96 99
     return processutils.execute(*cmd, **kwargs)
97 100
 
98 101
 

Loading…
Cancel
Save