Revision c51f3a08 snf-cyclades-app/synnefo/api/management/commands/server-inspect.py

b/snf-cyclades-app/synnefo/api/management/commands/server-inspect.py
56 56
    args = "<server ID>"
57 57

  
58 58
    option_list = BaseCommand.option_list + (
59
        make_option('--jobs', action='store_true',
60
                    dest='jobs', default=False,
61
                    help="Show non-archived jobs concerning server."
62
            ),
59
        make_option('--jobs',
60
            action='store_true',
61
            dest='jobs',
62
            default=False,
63
            help="Show non-archived jobs concerning server."),
64
        make_option('--uuids',
65
            action='store_true',
66
            dest='use_uuids',
67
            default=False,
68
            help="Display UUIDs instead of user emails"),
63 69
    )
64 70

  
65 71
    def handle(self, *args, **options):
......
77 83
        labels = ('name', 'owner', 'flavor', 'image', 'state', 'backend',
78 84
                  'deleted', 'action', 'backendjobid', 'backendopcode',
79 85
                  'backendjobstatus', 'backend_time')
80
        fields = (vm.name, vm.userid, vm.flavor.name, image,
86

  
87
        user = vm.userid
88
        if options['use_uuids'] is False:
89
            ucache = common.UUIDCache()
90
            user = ucache.get_user(vm.userid)
91

  
92
        fields = (vm.name, user, vm.flavor.name, image,
81 93
                  common.format_vm_state(vm), str(vm.backend),
82 94
                  str(vm.deleted), str(vm.action), str(vm.backendjobid),
83 95
                  str(vm.backendopcode), str(vm.backendjobstatus),

Also available in: Unified diff