Permalink
Browse files

Implement a tool to list locations.

  • Loading branch information...
1 parent 716b666 commit b257df7ae245edb323b79730b2439185c8f80cc3 @novel committed Dec 12, 2010
Showing with 14 additions and 0 deletions.
  1. +6 −0 lc-locations-list
  2. +8 −0 lctools/printer.py
View
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+from lctools.shortcuts import lister_main
+
+if __name__ == "__main__":
+ lister_main('locations')
View
@@ -62,3 +62,11 @@ def _print_node(self, thing, format=None):
else:
fmt = "%(id)s\t%(name)s\t%(ip)s\t%(rstatus)s\n"
sys.stdout.write(fmt % values)
+
+ @classmethod
+ def _print_nodelocation(self, thing, format=None):
+ values = thing.__dict__.copy()
+
+ fmt = "%(id)s\t%(name)s\t%(country)s\n"
+
+ sys.stdout.write(fmt % values)

0 comments on commit b257df7

Please sign in to comment.