From e27202d178bf8daf10fa928412ffcacd855215fa Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 11 Jun 2019 08:23:59 -0400 Subject: [PATCH] createpool: Use StoragePool.default_target_path Indirectly, rather than the less useful get_default_dir --- virtManager/createpool.py | 7 ++++++- virtinst/storage.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/virtManager/createpool.py b/virtManager/createpool.py index 06ac9993b..c0c1cd7fa 100644 --- a/virtManager/createpool.py +++ b/virtManager/createpool.py @@ -5,6 +5,7 @@ # See the COPYING file in the top-level directory. import logging +import os from gi.repository import Gdk from gi.repository import Gtk @@ -481,7 +482,11 @@ class vmmCreatePool(vmmGObjectUI): self.widget("pool-source-path").get_child().set_text(source) def _browse_target_cb(self, src): - startfolder = StoragePool.get_default_dir(self.conn.get_backend()) + current = self.widget("pool-target-path").get_child().get_text() + startfolder = None + if current: + startfolder = os.path.dirname(current) + target = self.err.browse_local(self.conn, _("Choose target directory"), dialog_type=Gtk.FileChooserAction.SELECT_FOLDER, diff --git a/virtinst/storage.py b/virtinst/storage.py index b58129ffb..73fe53965 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -313,7 +313,8 @@ class StoragePool(_StorageObject): if (self.type == self.TYPE_DIR or self.type == self.TYPE_NETFS or self.type == self.TYPE_FS): - return os.path.join(self.get_default_dir(self.conn), self.name) + return os.path.join( + _preferred_default_pool_path(self.conn), self.name) if self.type == self.TYPE_LOGICAL: name = self.name if self.source_name: