Switch deprecating log.warn to log.warning

Same semantics, but the alias is deprecated
This commit is contained in:
Cole Robinson 2017-05-05 14:21:15 -04:00
parent f551d7e55d
commit a90d675394
6 changed files with 22 additions and 22 deletions

View File

@ -375,7 +375,7 @@ def get_guest(conn, options):
conn.is_qemu() and
guest.os.arch in ["i686", "x86_64"] and
not guest.type == "kvm"):
logging.warn("KVM acceleration not available, using '%s'",
logging.warning("KVM acceleration not available, using '%s'",
guest.type)
return guest
@ -494,7 +494,7 @@ def _show_nographics_warnings(options, guest):
return
if guest.installer.cdrom:
logging.warn(_("CDROM media does not print to the text console "
logging.warning(_("CDROM media does not print to the text console "
"by default, so you likely will not see text install output. "
"You might want to use --location.") + " " +
_cdrom_location_man_page)
@ -507,7 +507,7 @@ def _show_nographics_warnings(options, guest):
# they likely won't see any output.
if not guest.get_devices("console"):
logging.warn(_("No --console device added, you likely will not "
logging.warning(_("No --console device added, you likely will not "
"see text install output from the guest."))
return
@ -529,19 +529,19 @@ def _show_nographics_warnings(options, guest):
if console_type in (args or ""):
return
logging.warn(_("Did not find '%(console_string)s' in --extra-args, "
logging.warning(_("Did not find '%(console_string)s' in --extra-args, "
"which is likely required to see text install output from the "
"guest."), {"console_string": console_type})
def show_warnings(options, guest):
if options.pxe and not supports_pxe(guest):
logging.warn(_("The guest's network configuration does not support "
logging.warning(_("The guest's network configuration does not support "
"PXE"))
if (guest.os_variant == "generic" and
options.distro_variant not in ["none", "generic"]):
logging.warn(_("No operating system detected, VM performance may "
logging.warning(_("No operating system detected, VM performance may "
"suffer. Specify an OS with --os-variant for optimal results."))
_show_nographics_warnings(options, guest)
@ -630,8 +630,8 @@ def build_guest_instance(conn, options):
except Exception as e:
logging.debug("Error setting UEFI default for aarch64",
exc_info=True)
logging.warn("Couldn't configure UEFI: %s", e)
logging.warn("Your aarch64 VM may not boot successfully.")
logging.warning("Couldn't configure UEFI: %s", e)
logging.warning("Your aarch64 VM may not boot successfully.")
# Various little validations about option collisions. Need to do
# this after setting guest.installer at least

View File

@ -371,7 +371,7 @@ def validate_disk(dev, warn_overwrite=False):
logging.debug("Skipping --check %s error condition '%s'",
checkname, msg)
if warn_on_skip:
logging.warn(msg)
logging.warning(msg)
def check_path_exists(dev):
"""
@ -495,13 +495,13 @@ def get_console_cb(guest):
try:
subprocess.check_output(["virt-viewer", "--version"])
except OSError:
logging.warn(_("Unable to connect to graphical console: "
logging.warning(_("Unable to connect to graphical console: "
"virt-viewer not installed. Please install "
"the 'virt-viewer' package."))
return None
if not os.environ.get("DISPLAY", ""):
logging.warn(_("Graphics requested but DISPLAY is not set. "
logging.warning(_("Graphics requested but DISPLAY is not set. "
"Not running virt-viewer."))
return None
@ -2222,16 +2222,16 @@ class ParserGraphics(VirtCLIParser):
if inst.conn.is_qemu() and inst.gl:
if inst.type != "spice":
logging.warn("graphics type=%s does not support GL", inst.type)
logging.warning("graphics type=%s does not support GL", inst.type)
elif not inst.conn.check_support(
inst.conn.SUPPORT_CONN_SPICE_GL):
logging.warn("qemu/libvirt version may not support spice GL")
logging.warning("qemu/libvirt version may not support spice GL")
if inst.conn.is_qemu() and inst.rendernode:
if inst.type != "spice":
logging.warn("graphics type=%s does not support rendernode", inst.type)
logging.warning("graphics type=%s does not support rendernode", inst.type)
elif not inst.conn.check_support(
inst.conn.SUPPORT_CONN_SPICE_RENDERNODE):
logging.warn("qemu/libvirt version may not support rendernode")
logging.warning("qemu/libvirt version may not support rendernode")
return ret
@ -2625,11 +2625,11 @@ class ParserVideo(VirtCLIParser):
if inst.conn.is_qemu() and inst.accel3d:
if inst.model != "virtio":
logging.warn("video model=%s does not support accel3d",
logging.warning("video model=%s does not support accel3d",
inst.model)
elif not inst.conn.check_support(
inst.conn.SUPPORT_CONN_VIDEO_VIRTIO_ACCEL3D):
logging.warn("qemu/libvirt version may not support "
logging.warning("qemu/libvirt version may not support "
"virtio accel3d")
return ret

View File

@ -411,7 +411,7 @@ class Cloner(object):
self._clone_macs.reverse()
for dev in self._guest.get_devices("graphics"):
if dev.port and dev.port != -1:
logging.warn(_("Setting the graphics device port to autoport, "
logging.warning(_("Setting the graphics device port to autoport, "
"in order to avoid conflicting."))
dev.port = -1

View File

@ -355,7 +355,7 @@ class _StorageCreator(_StorageBase):
if err:
raise ValueError(msg)
if msg:
logging.warn(msg)
logging.warning(msg)
def will_create_storage(self):
return True

View File

@ -453,7 +453,7 @@ class Guest(XMLBuilder):
self.domain.setAutostart(True)
except libvirt.libvirtError as e:
if util.is_error_nosupport(e):
logging.warn("Could not set autostart flag: libvirt "
logging.warning("Could not set autostart flag: libvirt "
"connection does not support autostart.")
else:
raise e

View File

@ -787,7 +787,7 @@ class StorageVolume(_StorageObject):
def validate(self):
if self._pool_xml.type == StoragePool.TYPE_LOGICAL:
if self.allocation != self.capacity:
logging.warn(_("Sparse logical volumes are not supported, "
logging.warning(_("Sparse logical volumes are not supported, "
"setting allocation equal to capacity"))
self.allocation = self.capacity
@ -795,7 +795,7 @@ class StorageVolume(_StorageObject):
if isfatal:
raise ValueError(errmsg)
if errmsg:
logging.warn(errmsg)
logging.warning(errmsg)
def install(self, meter=None):
"""