- machines = Machine.query().join('acl').filter_by(user=username)
- output = "Machine Name \t\t Owner \t\t contact \n\r"
- for m in machines:
- output += m.name + "\t" + m.owner +"\t" + m.contact + "\n\r"
- print output
+ output = {}
+ for m in database.Machine.query().join('acl').filter_by(user=username):
+ output[m.name] = dict(owner=m.owner, contact=m.contact)
+
+ print yaml.dump(output, Dumper=yaml.CSafeDumper, default_flow_style=False)