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.
This commit is contained in:
Cole Robinson 2014-05-31 16:30:00 -04:00
parent d6f063d0b8
commit ceab99cf7b
2 changed files with 5 additions and 3 deletions

View File

@ -270,7 +270,7 @@ class VirtConverter(object):
disk_format = None disk_format = None
if destdir is 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() guest = self.get_guest()
for disk in guest.get_devices("disk"): for disk in guest.get_devices("disk"):

View File

@ -213,7 +213,7 @@ class StoragePool(_StorageObject):
@staticmethod @staticmethod
def get_default_path(conn): def get_default_path(conn, build=True):
""" """
Return the default storage path. If there's a 'default' pool, Return the default storage path. If there's a 'default' pool,
report that. If there's no default pool, return the path we would report that. If there's no default pool, return the path we would
@ -230,7 +230,9 @@ class StoragePool(_StorageObject):
except: except:
pass 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 @staticmethod