r1049 - in zope-common/trunk (debian/changelog dzhandle)

Fabio Tranchitella kobold at alioth.debian.org
Thu Nov 29 19:48:25 UTC 2007


    Date: Thursday, November 29, 2007 @ 19:48:25
  Author: kobold
Revision: 1049

* dzhandle:
  + accept a username-only paramter for the --service-user switch.
  + don't show useless actions in the help screen, noone uses them.

Modified:
  zope-common/trunk/debian/changelog
  zope-common/trunk/dzhandle

Modified: zope-common/trunk/debian/changelog
===================================================================
--- zope-common/trunk/debian/changelog	2007-11-29 19:16:05 UTC (rev 1048)
+++ zope-common/trunk/debian/changelog	2007-11-29 19:48:25 UTC (rev 1049)
@@ -10,7 +10,11 @@
     - Vietnamese. (Closes: #434757)
     - German. (Closes: #435273)
     - Czech. (Closes: #436282)
+  * dzhandle:
+    + accept a username-only paramter for the --service-user switch.
+    + don't show useless actions in the help screen, noone uses them.
 
+
   [ Bernd Zeimetz ]
   * Finally implement removing+reinstalling Zeo and Zope instances.
     (Closes: #429393, #431604)

Modified: zope-common/trunk/dzhandle
===================================================================
--- zope-common/trunk/dzhandle	2007-11-29 19:16:05 UTC (rev 1048)
+++ zope-common/trunk/dzhandle	2007-11-29 19:48:25 UTC (rev 1049)
@@ -373,6 +373,7 @@
     kind = 'extension'
     subdir = 'Extensions'
     dzname = '.dzextension'
+    list_on_help = False
 
 class Product(ProductAttributes, Addon):
     pass
@@ -389,6 +390,7 @@
     _option_parser = None
     name = None
     help = ""
+    list_on_help = True
     def __init__(self):
         self.errors_occured = 0
         parser = self.get_option_parser()
@@ -427,6 +429,7 @@
 
 class DZPreinst(DZAction):
     kind = None
+    list_on_help = False
     def get_option_parser(self):
         if not self._option_parser:
             p = OptionParser()
@@ -520,6 +523,7 @@
 class DZPreinstExtension(ExtensionAttributes, DZPreinst):
     name = 'preinst-%s' % ExtensionAttributes.kind
     help = 'handle preinst of a packaged %s' % ExtensionAttributes.kind
+    list_on_help = False
 
 register_action(DZPreinstProduct)
 register_action(DZPreinstExtension)
@@ -527,6 +531,7 @@
 
 class DZPostinst(DZAction):
     kind = None
+    list_on_help = False
     def get_option_parser(self):
         if not self._option_parser:
             p = OptionParser()
@@ -658,10 +663,12 @@
 class DZPostinstProduct(ProductAttributes, DZPostinst):
     name = 'postinst-%s' % ProductAttributes.kind
     help = 'handle postinst of a packaged %s' % ProductAttributes.kind
+    list_on_help = False
 
 class DZPostinstExtension(ExtensionAttributes, DZPostinst):
     name = 'postinst-%s' % ExtensionAttributes.kind
     help = 'handle postinst of a packaged %s' % ExtensionAttributes.kind
+    list_on_help = False
 
 register_action(DZPostinstProduct)
 register_action(DZPostinstExtension)
@@ -669,6 +676,7 @@
 
 class DZPrerm(DZAction):
     kind = None
+    list_on_help = False
     def get_option_parser(self):
         if not self._option_parser:
             p = OptionParser()
@@ -749,6 +757,7 @@
 class DZPrermExtension(ExtensionAttributes, DZPrerm):
     name = 'prerm-%s' % ExtensionAttributes.kind
     help = 'handle prerm of a packaged %s' % ExtensionAttributes.kind
+    list_on_help = False
 
 register_action(DZPrermProduct)
 register_action(DZPrermExtension)
@@ -756,6 +765,7 @@
 
 class DZPostrm(DZAction):
     kind = None
+    list_on_help = False
     def get_option_parser(self):
         if not self._option_parser:
             p = OptionParser()
@@ -787,6 +797,7 @@
 class DZPostrmExtension(ExtensionAttributes, DZPostrm):
     name = 'postrm-%s' % ExtensionAttributes.kind
     help = 'handle postrm of a packaged %s' % ExtensionAttributes.kind
+    list_on_help = False
 
 register_action(DZPostrmProduct)
 register_action(DZPostrmExtension)
@@ -853,10 +864,12 @@
 class DZDinstallProduct(ProductAttributes, DZDinstall):
     name = 'dinstall-product'
     help = 'install a packaged product'
+    list_on_help = False
 
 class DZDinstallExtension(ExtensionAttributes, DZDinstall):
     name = 'dinstall-extension'
     help = 'install a packaged extension'
+    list_on_help = False
 
 register_action(DZDinstallProduct)
 register_action(DZDinstallExtension)
@@ -914,10 +927,12 @@
 class DZDremoveProduct(ProductAttributes, DZDremove):
     name = 'dremove-product'
     help = 'remove a packaged product'
+    list_on_help = False
     
 class DZDremoveExtension(ExtensionAttributes, DZDremove):
     name = 'dremove-extension'
     help = 'remove a packaged extension'
+    list_on_help = False
 
 register_action(DZDremoveProduct)
 register_action(DZDremoveExtension)
@@ -1057,6 +1072,7 @@
 class DZAddExtension(ExtensionAttributes, DZAddAddon):
     name = 'add-extension'
     help = 'add an extension to an instance'
+    list_on_help = False
 
 register_action(DZAddProduct)
 register_action(DZAddExtension)
@@ -1154,6 +1170,7 @@
 class DZRemoveExtension(ExtensionAttributes, DZRemoveAddon):
     name = 'remove-extension'
     help = 'remove an extension from an instance'
+    list_on_help = False
 
 register_action(DZRemoveProduct)
 register_action(DZRemoveExtension)
@@ -1198,6 +1215,7 @@
 class DZListExtensions(ExtensionAttributes, DZListAddons):
     name = 'list-extensions'
     help = 'show all extensions managed by dzhandle'
+    list_on_help = False
 
 register_action(DZListProducts)
 register_action(DZListExtensions)
@@ -1256,6 +1274,7 @@
 class DZRestartPendingInstances(DZAction):
     name = 'restart-pending-instances'
     help = "restart instances with `restart-pending' markers"
+    list_on_help = False
 
     def check_args(self, global_options):
         if self.args:
@@ -1460,7 +1479,9 @@
             self.error('service user must be specified as user:group')
         else:
             try:
-                uid, gid = self.options.srvuser.split(":")
+                uid, gid = ':' in self.options.srvuser and \
+                    self.options.srvuser.split(':', 1) or \
+                    (self.options.srvuser, 'zope')
                 self.uid = pwd.getpwnam(uid)[2]
                 self.gid = grp.getgrnam(gid)[2]
             except KeyError, msg:
@@ -2396,7 +2417,8 @@
         parser.print_help()
         print "\nactions:"
         for n, a in sorted(known_actions.items()):
-            print "  %-21s %s" % (n, a.help)
+            if a.list_on_help:
+                print "  %-21s %s" % (n, a.help)
         print ""
         sys.exit(1)
 




More information about the pkg-zope-commits mailing list