This small check could have saved me some time/frustration today while
trying to use
pkg.client.image.Image.local_search()
Might be useful in case someone else stumbles on it later. It makes sure
that the args is an array, and not a single string, which the code using
it assumes.
-----------------
diff -r 402042d6c744 src/modules/client/image.py
--- a/src/modules/client/image.py Tue Apr 08 16:10:17 2008 -0700
+++ b/src/modules/client/image.py Tue Apr 08 17:58:57 2008 -0700
@@ -929,6 +929,9 @@
def local_search(self, args):
"""Search the image for the token in args[0]."""
+ if isinstance(args, basestring):
+ args = [args]
+
idxdir = os.path.join(self.imgdir, "pkg")
# Convert a full directory path to the FMRI it represents.
@@ -978,6 +981,9 @@
def remote_search(self, args, servers = None):
"""Search for the token in args[0] on the servers in
'servers'.
If 'servers' is empty or None, search on all known
servers."""
+ if isinstance(args, basestring):
+ args = [args]
+
failed = []
if not servers:
------------------
Thanks
Manpreet
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss