XenAPI: UT: Always mock logging configuration

The call to configure logging sets up logging to syslog.  Some
environments, such as the Ubuntu package builder environment,
do not permit this operation.

Logging is made to syslog as the plugin runs in dom0 on XenServer,
not with the rest of Nova, so the oslo logging capabilities can't
be used.

Mock out the call to configure logging to prevent attempts to use
syslog

Change-Id: Ie32691d980aff052498c6c5822828ba9703d412b
Closes-Bug: 1597433
This commit is contained in:
Bob Ball
2016-07-01 13:11:00 +01:00
parent 4e62960722
commit fc0dfb369e
@@ -22,6 +22,12 @@ from nova.tests.unit.virt.xenapi.plugins import plugin_test
class PartitionUtils(plugin_test.PluginTestBase):
def setUp(self):
super(PartitionUtils, self).setUp()
self.pluginlib = self.load_plugin("pluginlib_nova.py")
# Prevent any logging to syslog
self.mock_patch_object(self.pluginlib,
'configure_logging')
self.partition_utils = self.load_plugin("partition_utils.py")
def test_wait_for_dev_ok(self):