summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-02-07 20:11:55 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-02-08 21:53:55 +0000
commit2b538441a8aafde5dcc48939a091f22d1303f3bf (patch)
tree210f3668fbd5ae6ae1c378e9b11d8a2ea4dde9fd /nova/virt
parent85ae58c21fc9019dfef5585accd53bdc667debde (diff)
Use named logger when available
Cleanup a handful of places where named loggers are created for a particular module but aren't used consistently. Also fix a couple of log entries that aren't internationalized Change-Id: I38186d47e7f31626b3ead779707d8ee5a15f56ac
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/libvirt/firewall.py4
-rw-r--r--nova/virt/xenapi/vm_utils.py4
-rw-r--r--nova/virt/xenapi/vmops.py14
3 files changed, 11 insertions, 11 deletions
diff --git a/nova/virt/libvirt/firewall.py b/nova/virt/libvirt/firewall.py
index 0bfd89de1..8ad844f50 100644
--- a/nova/virt/libvirt/firewall.py
+++ b/nova/virt/libvirt/firewall.py
@@ -137,14 +137,14 @@ class NWFilterFirewall(base_firewall.FirewallDriver):
def setup_basic_filtering(self, instance, network_info):
"""Set up basic filtering (MAC, IP, and ARP spoofing protection)"""
- logging.info('called setup_basic_filtering in nwfilter')
+ LOG.info(_('called setup_basic_filtering in nwfilter'))
if self.handle_security_groups:
# No point in setting up a filter set that we'll be overriding
# anyway.
return
- logging.info('ensuring static filters')
+ LOG.info(_('ensuring static filters'))
self._ensure_static_filters()
if instance['image_ref'] == str(FLAGS.vpn_image_id):
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 91cbe2e38..72c2fbb94 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -378,8 +378,8 @@ class VMHelper(HelperBase):
"""
# NOTE(sirp): Currently we only support uploading images as VHD, there
# is no RAW equivalent (yet)
- logging.debug(_("Asking xapi to upload %(vdi_uuids)s as"
- " ID %(image_id)s") % locals())
+ LOG.debug(_("Asking xapi to upload %(vdi_uuids)s as"
+ " ID %(image_id)s") % locals())
glance_host, glance_port = glance.pick_glance_api_server()
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 30d77369b..b9461eba8 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -644,13 +644,13 @@ class VMOps(object):
self._destroy(instance, template_vm_ref,
shutdown=False, destroy_kernel_ramdisk=False)
- logging.debug(_("Finished snapshot and upload for VM %s"), instance)
+ LOG.debug(_("Finished snapshot and upload for VM %s"), instance)
def _create_snapshot(self, instance):
#TODO(sirp): Add quiesce and VSS locking support when Windows support
# is added
- logging.debug(_("Starting snapshot for VM %s"), instance['uuid'])
+ LOG.debug(_("Starting snapshot for VM %s"), instance['uuid'])
vm_ref = VMHelper.lookup(self._session, instance.name)
label = "%s-snapshot" % instance.name
@@ -659,8 +659,8 @@ class VMOps(object):
self._session, instance, vm_ref, label)
return template_vm_ref, template_vdi_uuids
except self.XenAPI.Failure, exc:
- logging.error(_("Unable to Snapshot %(vm_ref)s: %(exc)s")
- % locals())
+ LOG.error(_("Unable to Snapshot %(vm_ref)s: %(exc)s")
+ % locals())
return
def _migrate_vhd(self, instance, vdi_uuid, dest, sr_path):
@@ -1485,7 +1485,7 @@ class VMOps(object):
self._session.call_xenapi("VM.get_record", vm_ref)
else:
vm_ref = VMHelper.lookup(self._session, instance.name)
- logging.debug(_("injecting network info to xs for vm: |%s|"), vm_ref)
+ LOG.debug(_("injecting network info to xs for vm: |%s|"), vm_ref)
for (network, info) in network_info:
location = 'vm-data/networking/%s' % info['mac'].replace(':', '')
@@ -1503,7 +1503,7 @@ class VMOps(object):
def create_vifs(self, vm_ref, instance, network_info):
"""Creates vifs for an instance."""
- logging.debug(_("creating vif(s) for vm: |%s|"), vm_ref)
+ LOG.debug(_("creating vif(s) for vm: |%s|"), vm_ref)
# this function raises if vm_ref is not a vm_opaque_ref
self._session.call_xenapi("VM.get_record", vm_ref)
@@ -1544,7 +1544,7 @@ class VMOps(object):
# NOTE(jk0): Windows hostnames can only be <= 15 chars.
hostname = hostname[:15]
- logging.debug(_("injecting hostname to xs for vm: |%s|"), vm_ref)
+ LOG.debug(_("injecting hostname to xs for vm: |%s|"), vm_ref)
self._session.call_xenapi_request("VM.add_to_xenstore_data",
(vm_ref, "vm-data/hostname", hostname))