From ceab99cf7bb47d06af0a209512c4a022acc84a85 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 31 May 2014 16:30:00 -0400 Subject: [PATCH] virtconv: Don't create default pool when in dry mode We will still need to create pools to probe source storage if doing --print-xml. --- virtconv/formats.py | 2 +- virtinst/storage.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/virtconv/formats.py b/virtconv/formats.py index 2af6b6bd9..ff997c630 100644 --- a/virtconv/formats.py +++ b/virtconv/formats.py @@ -270,7 +270,7 @@ class VirtConverter(object): disk_format = None if destdir is None: - destdir = StoragePool.get_default_path(self.conn) + destdir = StoragePool.get_default_path(self.conn, build=not dry) guest = self.get_guest() for disk in guest.get_devices("disk"): diff --git a/virtinst/storage.py b/virtinst/storage.py index 98fcc7c15..85c0bc707 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -213,7 +213,7 @@ class StoragePool(_StorageObject): @staticmethod - def get_default_path(conn): + def get_default_path(conn, build=True): """ Return the default storage path. If there's a 'default' pool, report that. If there's no default pool, return the path we would @@ -230,7 +230,9 @@ class StoragePool(_StorageObject): except: pass - return StoragePool.build_default_pool(conn).target_path + if build: + return StoragePool.build_default_pool(conn).target_path + return _get_default_pool_path(conn) @staticmethod