VMM/cli/subcommands: Update also the RunContext's subcommand if v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Thu, 20 Jan 2011 00:41:09 +0000
branchv0.6.x
changeset 376 2af61bc06215
parent 375 4cbaf8d229f9
child 377 920cb090eb09
VMM/cli/subcommands: Update also the RunContext's subcommand if 'plan A' in {alias,relocated,user}_info() fails.
VirtualMailManager/cli/subcommands.py
--- a/VirtualMailManager/cli/subcommands.py	Thu Jan 20 00:22:52 2011 +0000
+++ b/VirtualMailManager/cli/subcommands.py	Thu Jan 20 00:41:09 2011 +0000
@@ -114,12 +114,12 @@
         if err.code is ACCOUNT_EXISTS:
             w_err(0, ctx.plan_a_b % {'subcommand': u'userinfo',
                   'object': address})
-            ctx.args[1] = 'userinfo'
+            ctx.scmd = ctx.args[1] = 'userinfo'
             user_info(ctx)
         elif err.code is RELOCATED_EXISTS:
             w_std(0, ctx.plan_a_b % {'subcommand': u'relocatedinfo',
                   'object': address})
-            ctx.args[1] = 'relocatedinfo'
+            ctx.scmd = ctx.args[1] = 'relocatedinfo'
             relocated_info(ctx)
         else:
             raise
@@ -367,12 +367,12 @@
         if err.code is ACCOUNT_EXISTS:
             w_err(0, ctx.plan_a_b % {'subcommand': u'userinfo',
                   'object': relocated})
-            ctx.args[1] = 'userinfoi'
+            ctx.scmd = ctx.args[1] = 'userinfoi'
             user_info(ctx)
         elif err.code is ALIAS_EXISTS:
             w_err(0, ctx.plan_a_b % {'subcommand': u'aliasinfo',
                   'object': relocated})
-            ctx.args[1] = 'aliasinfo'
+            ctx.scmd = ctx.args[1] = 'aliasinfo'
             alias_info(ctx)
         else:
             raise
@@ -451,12 +451,12 @@
         if err.code is ALIAS_EXISTS:
             w_err(0, ctx.plan_a_b % {'subcommand': u'aliasinfo',
                   'object': ctx.args[2].lower()})
-            ctx.args[1] = 'aliasinfo'
+            ctx.scmd = ctx.args[1] = 'aliasinfo'
             alias_info(ctx)
         elif err.code is RELOCATED_EXISTS:
             w_err(0, ctx.plan_a_b % {'subcommand': u'relocatedinfo',
                   'object': ctx.args[2].lower()})
-            ctx.args[1] = 'relocatedinfo'
+            ctx.scmd = ctx.args[1] = 'relocatedinfo'
             relocated_info(ctx)
         else:
             raise