On 01/03/12 23:30, Shawn Walker wrote:
On 01/03/12 07:13, Saurabh Vyas wrote:
<< resending this review >>

Hi All,

I fixed this issue on my machine (/etc/hosts ) and had a clean test
run.

Please review this fix :

18958 - Error message concerning /var/pkg/lock & lack of privileges
could be improved
7123469 error handling in __api_plan_exception can be improved

webrev : https://cr.opensolaris.org/action/browse/pkg/saurabhv/18958/

and let me know your comments.

doc/client_api_versions.txt:
line 6: Actually, you named it UnprivilegedUserError, not ImageLockedError.

src/modules/client/api_errors.py:
line 386: leftover debug line

Thanks Shawn,

I made the necessary changes & rebuild the webrev.
I am facing issue in accessing  cr.opensolaris.org so cannot
post the webrev

-----<snip>------

HTTP Status 404 -

type Status report

message

description The requested resource () is not available.
-----------------------------------------------------

Is cr.opensolaris.org down ??

Apart I have created the patch for this issue (attached).
Please let me know if this patch is good to be integrated.

Thanks again,
~Saurabh


Otherwise, this looks right to me.

-Shawn



--


Saurabh Vyas
Solaris Install Group,
Revenue Product Engineering (RPE), Systems

ORACLE India | Off Langford Road | Bangalore | 560025

|Bangalore |
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment
# HG changeset patch
# User [email protected]
# Date 1325661183 -19800
# Node ID 19706b672ffede6ec808fe858cc6a9a32a192806
# Parent  d3e01902d108edd2cea7cc21a46e5d0281b24ae3
18958 Error message concerning /var/pkg/lock & lack of privileges could be 
improved
7123469 error handling in __api_plan_exception can be improved

diff -r d3e01902d108 -r 19706b672ffe doc/client_api_versions.txt
--- a/doc/client_api_versions.txt       Thu Dec 29 11:10:32 2011 -0800
+++ b/doc/client_api_versions.txt       Wed Jan 04 12:43:03 2012 +0530
@@ -1,3 +1,11 @@
+Version 71:
+Compatible with clients using versions 66-70.
+
+    pkg.client.api_errors has changed as follows:
+
+        * Added UnprivilegedUserError to indicate when the current user
+          does not have sufficient privileges to modify the image.
+
 Version 70:
 Compatible with clients using versions 66-69.
 
diff -r d3e01902d108 -r 19706b672ffe src/client.py
--- a/src/client.py     Thu Dec 29 11:10:32 2011 -0800
+++ b/src/client.py     Wed Jan 04 12:43:03 2012 +0530
@@ -87,7 +87,7 @@
         import sys
         sys.exit(1)
 
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 PKG_CLIENT_NAME = "pkg"
 
 JUST_UNKNOWN = 0
@@ -1475,11 +1475,11 @@
                         return EXIT_BADOPT
                 return EXIT_OOPS
 
-        if e_type in (api_errors.CertificateError,
+        if isinstance(e, (api_errors.CertificateError,
             api_errors.UnknownErrors,
             api_errors.PermissionsException,
             api_errors.InvalidPropertyValue,
-            api_errors.InvalidResourceLocation):
+            api_errors.InvalidResourceLocation)):
                 # Prepend a newline because otherwise the exception will
                 # be printed on the same line as the spinner.
                 error("\n" + str(e), cmd=op)
diff -r d3e01902d108 -r 19706b672ffe src/modules/client/api.py
--- a/src/modules/client/api.py Thu Dec 29 11:10:32 2011 -0800
+++ b/src/modules/client/api.py Wed Jan 04 12:43:03 2012 +0530
@@ -77,8 +77,8 @@
 from pkg.client.pkgdefs import *
 from pkg.smf import NonzeroExitException
 
-CURRENT_API_VERSION = 70
-COMPATIBLE_API_VERSIONS = frozenset([66, 67, 68, 69, CURRENT_API_VERSION])
+CURRENT_API_VERSION = 71
+COMPATIBLE_API_VERSIONS = frozenset([66, 67, 68, 69, 70, CURRENT_API_VERSION])
 CURRENT_P5I_VERSION = 1
 
 # Image type constants.
diff -r d3e01902d108 -r 19706b672ffe src/modules/client/api_errors.py
--- a/src/modules/client/api_errors.py  Thu Dec 29 11:10:32 2011 -0800
+++ b/src/modules/client/api_errors.py  Wed Jan 04 12:43:03 2012 +0530
@@ -380,6 +380,16 @@
                     "operation again.") % self.path
 
 
+class UnprivilegedUserError(PermissionsException):
+        def __init__(self, path):
+                PermissionsException.__init__(self, path)
+
+        def __str__(self):
+                return _("Insufficient access to complete the requested "
+                    "operation.\nPlease try the operation again as a "
+                    "privileged user.")
+
+
 class ReadOnlyFileSystemException(PermissionsException):
         """Used to indicate that the operation was attempted on a
         read-only filesystem"""
diff -r d3e01902d108 -r 19706b672ffe src/modules/client/image.py
--- a/src/modules/client/image.py       Thu Dec 29 11:10:32 2011 -0800
+++ b/src/modules/client/image.py       Wed Jan 04 12:43:03 2012 +0530
@@ -463,7 +463,7 @@
                         if e.errno == errno.ENOENT:
                                 return
                         if e.errno == errno.EACCES:
-                                exc = apx.PermissionsException(e.filename)
+                                exc = apx.UnprivilegedUserError(e.filename)
                         elif e.errno == errno.EROFS:
                                 exc = apx.ReadOnlyFileSystemException(
                                     e.filename)
diff -r d3e01902d108 -r 19706b672ffe src/modules/gui/misc_non_gui.py
--- a/src/modules/gui/misc_non_gui.py   Thu Dec 29 11:10:32 2011 -0800
+++ b/src/modules/gui/misc_non_gui.py   Wed Jan 04 12:43:03 2012 +0530
@@ -41,7 +41,7 @@
 
 # The current version of the Client API the PM, UM and
 # WebInstall GUIs have been tested against and are known to work with.
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 LOG_DIR = "/var/tmp"
 LOG_ERROR_EXT = "_error.log"
 LOG_INFO_EXT = "_info.log"
diff -r d3e01902d108 -r 19706b672ffe src/modules/lint/engine.py
--- a/src/modules/lint/engine.py        Thu Dec 29 11:10:32 2011 -0800
+++ b/src/modules/lint/engine.py        Wed Jan 04 12:43:03 2012 +0530
@@ -39,7 +39,7 @@
 import sys
 
 PKG_CLIENT_NAME = "pkglint"
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 pkg.client.global_settings.client_name = PKG_CLIENT_NAME
 
 class LintEngineException(Exception):
diff -r d3e01902d108 -r 19706b672ffe src/pkgdep.py
--- a/src/pkgdep.py     Thu Dec 29 11:10:32 2011 -0800
+++ b/src/pkgdep.py     Wed Jan 04 12:43:03 2012 +0530
@@ -42,7 +42,7 @@
 import pkg.publish.dependencies as dependencies
 from pkg.misc import msg, emsg, PipeError
 
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 PKG_CLIENT_NAME = "pkgdepend"
 
 DEFAULT_SUFFIX = ".res"
diff -r d3e01902d108 -r 19706b672ffe src/sysrepo.py
--- a/src/sysrepo.py    Thu Dec 29 11:10:32 2011 -0800
+++ b/src/sysrepo.py    Wed Jan 04 12:43:03 2012 +0530
@@ -53,7 +53,7 @@
 orig_cwd = None
 
 PKG_CLIENT_NAME = "pkg.sysrepo"
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 pkg.client.global_settings.client_name = PKG_CLIENT_NAME
 
 # exit codes
diff -r d3e01902d108 -r 19706b672ffe src/tests/pkg5unittest.py
--- a/src/tests/pkg5unittest.py Thu Dec 29 11:10:32 2011 -0800
+++ b/src/tests/pkg5unittest.py Wed Jan 04 12:43:03 2012 +0530
@@ -126,7 +126,7 @@
 
 # Version test suite is known to work with.
 PKG_CLIENT_NAME = "pkg"
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 
 ELIDABLE_ERRORS = [ TestSkippedException, depotcontroller.DepotStateException ]
 
diff -r d3e01902d108 -r 19706b672ffe src/util/distro-import/importer.py
--- a/src/util/distro-import/importer.py        Thu Dec 29 11:10:32 2011 -0800
+++ b/src/util/distro-import/importer.py        Wed Jan 04 12:43:03 2012 +0530
@@ -57,7 +57,7 @@
 from pkg.misc import emsg
 from pkg.portable import PD_LOCAL_PATH, PD_PROTO_DIR, PD_PROTO_DIR_LIST
 
-CLIENT_API_VERSION = 70
+CLIENT_API_VERSION = 71
 PKG_CLIENT_NAME = "importer.py"
 pkg.client.global_settings.client_name = PKG_CLIENT_NAME
 
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to