@cliutils.arg('node', metavar='<node>', help="Name or UUID of the node.")
@cliutils.arg(
    'provision_state',
    metavar='<provision-state>',
    choices=['active', 'deleted', 'rebuild', 'inspect', 'provide',
             'manage', 'clean', 'abort'],
    help="Supported states: 'active', 'deleted', 'rebuild', "
         "'inspect', 'provide', 'manage', 'clean' or 'abort'.")
@cliutils.arg(
    '--config-drive',
    metavar='<config-drive>',
    default=None,
    help=("A gzipped, base64-encoded configuration drive string OR the path "
          "to the configuration drive file OR the path to a directory "
          "containing the config drive files. In case it's a directory, a "
          "config drive will be generated from it. This argument is only "
          "valid when setting provision-state to 'active'."))
@cliutils.arg(
    '--clean-steps',
    metavar='<clean-steps>',
    default=None,
    help=("The clean steps in JSON format. May be the path to a file "
          "containing the clean steps; OR '-', with the clean steps being "
          "read from standard input; OR a string. The value should be "
          "a list of clean-step dictionaries; each dictionary should have "
          "keys 'interface' and 'step', and optional key 'args'. "
          "This argument must be specified (and is only valid) when "
          "setting provision-state to 'clean'."))
def do_node_set_provision_state(cc, args):
    if args.config_drive and args.provision_state != 'active':
        raise exceptions.CommandError(_('--config-drive is only valid when '
                                        'setting provision state to "active"'))
    elif args.clean_steps and args.provision_state != 'clean':
        raise exceptions.CommandError(_('--clean-steps is only valid when '
                                        'setting provision state to "clean"'))
    elif args.provision_state == 'clean' and not args.clean_steps:
        raise exceptions.CommandError(_('--clean-steps must be specified when '
                                        'setting provision state to "clean"'))

    clean_steps = args.clean_steps
    if args.clean_steps == '-':
        clean_steps = _get_from_stdin('clean steps')
    if clean_steps:
        clean_steps = _handle_json_or_file_arg(clean_steps)
    cc.node.set_provision_state(args.node, args.provision_state,
                                configdrive=args.config_drive,
                                cleansteps=clean_steps)
Check that the AttributeError from AttributeErrorRouter bubbles up
dataset/ETHPy150Open openstack/python-ironicclient/ironicclient/v1/node_shell.py/do_node_set_provision_state--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/multiple_database/tests.py/RouterAttributeErrorTestCase.test_attribute_error_m2m