Ignore:
Timestamp:
Oct 29, 2009, 12:52:59 AM (15 years ago)
Author:
price
Message:

Style fixes in, and Debian changelog for, list and listuser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-listuser

    r2510 r2516  
    11#!/usr/bin/python
    22"""
    3 Lists what a user's VM's are
     3Lists the VMs belonging to a given user.
    44"""
    55
    6 from subprocess import PIPE, Popen, call
    76import sys
    87import yaml
    98
    109from invirt import database
    11 from invirt.database import Machine, MachineAccess
    1210
    1311
     
    1917
    2018    database.connect()
    21     machines = Machine.query().join('acl').filter_by(user=username)
    2219    output = {}
    23     for m in machines:
    24        
    25         data = {}
    26         data['owner']=m.owner
    27         data['contact'] = m.contact
    28         output[m.name] = data
     20    for m in database.Machine.query().join('acl').filter_by(user=username):
     21        output[m.name] = dict(owner=m.owner, contact=m.contact)
    2922
    3023    print yaml.dump(output, Dumper=yaml.CSafeDumper, default_flow_style=False)
    3124    return 0
     25
     26
    3227if __name__ == '__main__':
    3328    sys.exit(main(sys.argv))
    34 
    35 # vim:et:sw=4:ts=4
Note: See TracChangeset for help on using the changeset viewer.