From 137134650f6a15b2bf36e846e16e77a002d9d758 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Tue, 18 Jun 2013 16:12:37 +0200 Subject: [PATCH] Allow partial address formatting Signed-off-by: Martin Kletzander --- tests/xmlconfig-xml/boot-many-devices.xml | 1 + virtinst/VirtualDevice.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/xmlconfig-xml/boot-many-devices.xml b/tests/xmlconfig-xml/boot-many-devices.xml index bfcc4bde7..64c0a5e26 100644 --- a/tests/xmlconfig-xml/boot-many-devices.xml +++ b/tests/xmlconfig-xml/boot-many-devices.xml @@ -38,6 +38,7 @@ +
diff --git a/virtinst/VirtualDevice.py b/virtinst/VirtualDevice.py index 2fb2b89ed..bbc32a618 100644 --- a/virtinst/VirtualDevice.py +++ b/virtinst/VirtualDevice.py @@ -1,7 +1,7 @@ # # Base class for all VM devices # -# Copyright 2008 Red Hat, Inc. +# Copyright 2008, 2013 Red Hat, Inc. # Cole Robinson # # This program is free software; you can redistribute it and/or modify @@ -267,14 +267,17 @@ class VirtualDeviceAddress(XMLBuilderDomain): if not self.type: return + def format_props(*args): + return "".join([" %s='%s'" % (k, getattr(self, k)) for k in args if getattr(self, k, None) is not None]) + xml = "