Changeset 2509 for trunk/packages


Ignore:
Timestamp:
Oct 19, 2009, 9:39:05 PM (15 years ago)
Author:
pweaver
Message:

Modified the output of remctl listuser to use YAML

File:
1 edited

Legend:

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

    r2508 r2509  
    2020    database.connect()
    2121    machines = Machine.query().join('acl').filter_by(user=username)
    22     output = "Machine Name \t\t Owner \t\t contact \n\r"
     22    output = {}
    2323    for m in machines:
    24         output +=  m.name + "\t" + m.owner +"\t" +  m.contact + "\n\r"
     24       
     25        data = {}
     26        data['owner']=m.owner
     27        data['contact'] = m.contact
     28        output[m.name] = data
     29
    2530    print output
     31    print yaml.dump(output, Dumper=yaml.CSafeDumper, default_flow_style=False)
    2632    return 0
    2733if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.