I've done a full test run with these bits, as well as run image-create both
with an absolute and a relative path, and everything passes as it should.
I won't bother with a webrev, the change is rather simple:
diff --git a/src/modules/client/image.py b/src/modules/client/image.py
--- a/src/modules/client/image.py
+++ b/src/modules/client/image.py
@@ -318,7 +318,7 @@ class Image(object):
# remove any directories beneath us. If we're changing the
# image, don't chdir, as we're likely changing to a new BE
# and want to be able to unmount it later.
- if not self.imgdir:
+ if not self.imgdir and os.path.isdir(root):
os.chdir(root)
self.imgdir = os.path.join(self.root, self.img_prefix)
diff --git a/src/tests/cli/testutils.py b/src/tests/cli/testutils.py
--- a/src/tests/cli/testutils.py
+++ b/src/tests/cli/testutils.py
@@ -245,6 +245,7 @@ class CliTestCase(pkg5unittest.Pkg5TestC
def setUp(self):
self.image_dir = None
self.pid = os.getpid()
+ self.pwd = os.getcwd()
self.__test_prefix = os.path.join(tempfile.gettempdir(),
"ips.test.%d" % self.pid)
@@ -330,6 +331,7 @@ class CliTestCase(pkg5unittest.Pkg5TestC
def image_destroy(self):
self.debug("image_destroy")
+ os.chdir(self.pwd)
if os.path.exists(self.img_path):
shutil.rmtree(self.img_path)
Thanks,
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss