summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-info29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index 55650f18b..8754fb066 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -531,21 +531,34 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
except:
print("Client %s not defined" % client)
continue
- print("Hostname:\t%s" % client_meta.hostname)
- print("Profile:\t%s" % client_meta.profile)
- print("Groups:\t\t%s" % list(client_meta.groups)[0])
- for grp in list(client_meta.groups)[1:]:
- print("\t\t%s" % grp)
+ fmt = "%-10s %s"
+ print(fmt % ("Hostname:", client_meta.hostname))
+ print(fmt % ("Profile:", client_meta.profile))
+
+ group_fmt = "%-10s %-30s %s"
+ header = False
+ for group in list(client_meta.groups):
+ category = ""
+ for cat, grp in client_meta.categories.items():
+ if grp == group:
+ category = "Category: %s" % cat
+ break
+ if not header:
+ print(group_fmt % ("Groups:", group, category))
+ header = True
+ else:
+ print(group_fmt % ("", group, category))
+
if client_meta.bundles:
- print("Bundles:\t%s" % list(client_meta.bundles)[0])
+ print(fmt % ("Bundles:", list(client_meta.bundles)[0]))
for bnd in list(client_meta.bundles)[1:]:
- print("\t\t%s" % bnd)
+ print(fmt % ("", bnd))
if client_meta.connectors:
print("Connector data")
print("=" * 80)
for conn in client_meta.connectors:
if getattr(client_meta, conn):
- print("%s:\t%s" % (conn, getattr(client_meta, conn)))
+ print(fmt % (conn + ":", getattr(client_meta, conn)))
print("=" * 80)
def do_mappings(self, args):