Improve service instance module debug logging

Change-Id: Ib3a9bebe362609d7198e053afebc6004f3d94baf
(cherry picked from commit 2117632c50)
(cherry picked from commit bb6256b5e8)
(cherry picked from commit 041f60a7b0)
This commit is contained in:
Tom Barron 2018-12-29 20:57:25 -06:00
parent 14bf24b231
commit 895bfd4f7a
4 changed files with 14 additions and 3 deletions

View File

@ -21,7 +21,7 @@ from oslo_log import log
import six import six
from manila import exception from manila import exception
from manila.i18n import _, _LE, _LW from manila.i18n import _, _LE, _LI, _LW
from manila.network.linux import ip_lib from manila.network.linux import ip_lib
from manila.network.linux import ovs_lib from manila.network.linux import ovs_lib
from manila import utils from manila import utils
@ -143,7 +143,8 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
if not ip_lib.device_exists(device_name, if not ip_lib.device_exists(device_name,
namespace=namespace): namespace=namespace):
LOG.info(_LI("Device %s does not exist - creating ...."),
device_name)
tap_name = self._get_tap_name(device_name) tap_name = self._get_tap_name(device_name)
self._ovs_add_port(bridge, tap_name, port_id, mac_address) self._ovs_add_port(bridge, tap_name, port_id, mac_address)
ns_dev.link.set_address(mac_address) ns_dev.link.set_address(mac_address)
@ -154,7 +155,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
namespace_obj.add_device_to_namespace(ns_dev) namespace_obj.add_device_to_namespace(ns_dev)
else: else:
LOG.warning(_LW("Device %s already exists."), device_name) LOG.info(_LI("Device %s already exists."), device_name)
if ns_dev.link.address != mac_address: if ns_dev.link.address != mac_address:
LOG.warning(_LW("Reset mac address to %s"), mac_address) LOG.warning(_LW("Reset mac address to %s"), mac_address)
ns_dev.link.set_address(mac_address) ns_dev.link.set_address(mac_address)

View File

@ -141,6 +141,8 @@ class GenericShareDriver(driver.ExecuteMixin, driver.ShareDriver):
driver_config=self.configuration)) driver_config=self.configuration))
def _ssh_exec(self, server, command, check_exit_code=True): def _ssh_exec(self, server, command, check_exit_code=True):
LOG.debug("_ssh_exec - server: %s, command: %s, check_exit_code: %s",
server, command, check_exit_code)
connection = self.ssh_connections.get(server['instance_id']) connection = self.ssh_connections.get(server['instance_id'])
ssh_conn_timeout = self.configuration.ssh_conn_timeout ssh_conn_timeout = self.configuration.ssh_conn_timeout
if not connection: if not connection:

View File

@ -910,6 +910,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
and setting up required network devices. and setting up required network devices.
""" """
if self.use_service_network: if self.use_service_network:
LOG.debug("Plugging service instance into service network %s.",
self.service_network_id)
port = self._get_service_port( port = self._get_service_port(
self.service_network_id, None, 'manila-share') self.service_network_id, None, 'manila-share')
port = self._add_fixed_ips_to_service_port(port) port = self._add_fixed_ips_to_service_port(port)
@ -918,6 +920,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
self._plug_interface_in_host(interface_name, device, port) self._plug_interface_in_host(interface_name, device, port)
if self.use_admin_port: if self.use_admin_port:
LOG.debug("Plugging service instance into admin network %s.",
self.admin_network_id)
port = self._get_service_port( port = self._get_service_port(
self.admin_network_id, self.admin_subnet_id, self.admin_network_id, self.admin_subnet_id,
'manila-admin-share') 'manila-admin-share')
@ -932,6 +936,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
external=True) external=True)
def _plug_interface_in_host(self, interface_name, device, port): def _plug_interface_in_host(self, interface_name, device, port):
LOG.debug("Plug interface into host - interface_name: %s, "
"device: %s, port: %s", interface_name, device, port)
self.vif_driver.plug(interface_name, port['id'], port['mac_address']) self.vif_driver.plug(interface_name, port['id'], port['mac_address'])
ip_cidrs = [] ip_cidrs = []
for fixed_ip in port['fixed_ips']: for fixed_ip in port['fixed_ips']:

View File

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