Browse Source

Improve service instance module debug logging

Change-Id: Ib3a9bebe362609d7198e053afebc6004f3d94baf
(cherry picked from commit 2117632c50)
(cherry picked from commit bb6256b5e8)
(cherry picked from commit 041f60a7b0)
changes/66/630966/3
Tom Barron 4 months ago
parent
commit
895bfd4f7a

+ 4
- 3
manila/network/linux/interface.py View File

@@ -21,7 +21,7 @@ from oslo_log import log
21 21
 import six
22 22
 
23 23
 from manila import exception
24
-from manila.i18n import _, _LE, _LW
24
+from manila.i18n import _, _LE, _LI, _LW
25 25
 from manila.network.linux import ip_lib
26 26
 from manila.network.linux import ovs_lib
27 27
 from manila import utils
@@ -143,7 +143,8 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
143 143
 
144 144
         if not ip_lib.device_exists(device_name,
145 145
                                     namespace=namespace):
146
-
146
+            LOG.info(_LI("Device %s does not exist - creating ...."),
147
+                     device_name)
147 148
             tap_name = self._get_tap_name(device_name)
148 149
             self._ovs_add_port(bridge, tap_name, port_id, mac_address)
149 150
             ns_dev.link.set_address(mac_address)
@@ -154,7 +155,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
154 155
                 namespace_obj.add_device_to_namespace(ns_dev)
155 156
 
156 157
         else:
157
-            LOG.warning(_LW("Device %s already exists."), device_name)
158
+            LOG.info(_LI("Device %s already exists."), device_name)
158 159
             if ns_dev.link.address != mac_address:
159 160
                 LOG.warning(_LW("Reset mac address to %s"), mac_address)
160 161
                 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

@@ -910,6 +910,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
910 910
         and setting up required network devices.
911 911
         """
912 912
         if self.use_service_network:
913
+            LOG.debug("Plugging service instance into service network %s.",
914
+                      self.service_network_id)
913 915
             port = self._get_service_port(
914 916
                 self.service_network_id, None, 'manila-share')
915 917
             port = self._add_fixed_ips_to_service_port(port)
@@ -918,6 +920,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
918 920
             self._plug_interface_in_host(interface_name, device, port)
919 921
 
920 922
         if self.use_admin_port:
923
+            LOG.debug("Plugging service instance into admin network %s.",
924
+                      self.admin_network_id)
921 925
             port = self._get_service_port(
922 926
                 self.admin_network_id, self.admin_subnet_id,
923 927
                 'manila-admin-share')
@@ -932,6 +936,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
932 936
                         external=True)
933 937
     def _plug_interface_in_host(self, interface_name, device, port):
934 938
 
939
+        LOG.debug("Plug interface into host - interface_name: %s, "
940
+                  "device: %s, port: %s", interface_name, device, port)
935 941
         self.vif_driver.plug(interface_name, port['id'], port['mac_address'])
936 942
         ip_cidrs = []
937 943
         for fixed_ip in port['fixed_ips']:

+ 2
- 0
manila/utils.py View File

@@ -67,6 +67,8 @@ def execute(*cmd, **kwargs):
67 67
     """Convenience wrapper around oslo's execute() function."""
68 68
     if 'run_as_root' in kwargs and 'root_helper' not in kwargs:
69 69
         kwargs['root_helper'] = _get_root_helper()
70
+    if hasattr('CONF', 'debug') and CONF.debug:
71
+        kwargs['loglevel'] = logging.DEBUG
70 72
     return processutils.execute(*cmd, **kwargs)
71 73
 
72 74
 

Loading…
Cancel
Save