VirtualMailManager/cli/subcommands.py
branchv0.6.x
changeset 376 2af61bc06215
parent 366 d6573da35b5f
child 397 cf661a40266d
equal deleted inserted replaced
375:4cbaf8d229f9 376:2af61bc06215
   112         _print_aliase_info(address, ctx.hdlr.alias_info(address))
   112         _print_aliase_info(address, ctx.hdlr.alias_info(address))
   113     except VMMError, err:
   113     except VMMError, err:
   114         if err.code is ACCOUNT_EXISTS:
   114         if err.code is ACCOUNT_EXISTS:
   115             w_err(0, ctx.plan_a_b % {'subcommand': u'userinfo',
   115             w_err(0, ctx.plan_a_b % {'subcommand': u'userinfo',
   116                   'object': address})
   116                   'object': address})
   117             ctx.args[1] = 'userinfo'
   117             ctx.scmd = ctx.args[1] = 'userinfo'
   118             user_info(ctx)
   118             user_info(ctx)
   119         elif err.code is RELOCATED_EXISTS:
   119         elif err.code is RELOCATED_EXISTS:
   120             w_std(0, ctx.plan_a_b % {'subcommand': u'relocatedinfo',
   120             w_std(0, ctx.plan_a_b % {'subcommand': u'relocatedinfo',
   121                   'object': address})
   121                   'object': address})
   122             ctx.args[1] = 'relocatedinfo'
   122             ctx.scmd = ctx.args[1] = 'relocatedinfo'
   123             relocated_info(ctx)
   123             relocated_info(ctx)
   124         else:
   124         else:
   125             raise
   125             raise
   126 
   126 
   127 
   127 
   365                               dest=ctx.hdlr.relocated_info(relocated))
   365                               dest=ctx.hdlr.relocated_info(relocated))
   366     except VMMError, err:
   366     except VMMError, err:
   367         if err.code is ACCOUNT_EXISTS:
   367         if err.code is ACCOUNT_EXISTS:
   368             w_err(0, ctx.plan_a_b % {'subcommand': u'userinfo',
   368             w_err(0, ctx.plan_a_b % {'subcommand': u'userinfo',
   369                   'object': relocated})
   369                   'object': relocated})
   370             ctx.args[1] = 'userinfoi'
   370             ctx.scmd = ctx.args[1] = 'userinfoi'
   371             user_info(ctx)
   371             user_info(ctx)
   372         elif err.code is ALIAS_EXISTS:
   372         elif err.code is ALIAS_EXISTS:
   373             w_err(0, ctx.plan_a_b % {'subcommand': u'aliasinfo',
   373             w_err(0, ctx.plan_a_b % {'subcommand': u'aliasinfo',
   374                   'object': relocated})
   374                   'object': relocated})
   375             ctx.args[1] = 'aliasinfo'
   375             ctx.scmd = ctx.args[1] = 'aliasinfo'
   376             alias_info(ctx)
   376             alias_info(ctx)
   377         else:
   377         else:
   378             raise
   378             raise
   379 
   379 
   380 
   380 
   449         info = ctx.hdlr.user_info(ctx.args[2].lower(), details)
   449         info = ctx.hdlr.user_info(ctx.args[2].lower(), details)
   450     except VMMError, err:
   450     except VMMError, err:
   451         if err.code is ALIAS_EXISTS:
   451         if err.code is ALIAS_EXISTS:
   452             w_err(0, ctx.plan_a_b % {'subcommand': u'aliasinfo',
   452             w_err(0, ctx.plan_a_b % {'subcommand': u'aliasinfo',
   453                   'object': ctx.args[2].lower()})
   453                   'object': ctx.args[2].lower()})
   454             ctx.args[1] = 'aliasinfo'
   454             ctx.scmd = ctx.args[1] = 'aliasinfo'
   455             alias_info(ctx)
   455             alias_info(ctx)
   456         elif err.code is RELOCATED_EXISTS:
   456         elif err.code is RELOCATED_EXISTS:
   457             w_err(0, ctx.plan_a_b % {'subcommand': u'relocatedinfo',
   457             w_err(0, ctx.plan_a_b % {'subcommand': u'relocatedinfo',
   458                   'object': ctx.args[2].lower()})
   458                   'object': ctx.args[2].lower()})
   459             ctx.args[1] = 'relocatedinfo'
   459             ctx.scmd = ctx.args[1] = 'relocatedinfo'
   460             relocated_info(ctx)
   460             relocated_info(ctx)
   461         else:
   461         else:
   462             raise
   462             raise
   463     else:
   463     else:
   464         if details in (None, 'du'):
   464         if details in (None, 'du'):