diff options
author | Jack Neely <jjneely@ncsu.edu> | 2011-06-10 13:29:23 -0400 |
---|---|---|
committer | Jack Neely <jjneely@ncsu.edu> | 2011-06-10 13:29:23 -0400 |
commit | 90c85147bacea14771abf8faa1fc5f185418d14b (patch) | |
tree | b10e06fc80ed714f5376b169e32b8953479211f1 /src/lib/Server/Admin/Viz.py | |
parent | 4f3da4543ec4e8c3c4776ae2ee3611e47ce78525 (diff) | |
parent | ce6a228d33ace4136dc2b5388c64795dfbd26ffb (diff) | |
download | bcfg2-90c85147bacea14771abf8faa1fc5f185418d14b.tar.gz bcfg2-90c85147bacea14771abf8faa1fc5f185418d14b.tar.bz2 bcfg2-90c85147bacea14771abf8faa1fc5f185418d14b.zip |
Merge branch 'master' of github.com:solj/bcfg2
Diffstat (limited to 'src/lib/Server/Admin/Viz.py')
-rw-r--r-- | src/lib/Server/Admin/Viz.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py index e3daea84b..f39e6d7a8 100644 --- a/src/lib/Server/Admin/Viz.py +++ b/src/lib/Server/Admin/Viz.py @@ -1,7 +1,9 @@ import getopt from subprocess import Popen, PIPE + import Bcfg2.Server.Admin + class Viz(Bcfg2.Server.Admin.MetadataCore): __shorthelp__ = "Produce graphviz diagrams of metadata structures" __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin viz [--includehosts] " @@ -27,7 +29,8 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): plugin_blacklist = ['DBStats', 'Snapshots', 'Cfg', 'Pkgmgr', 'Packages', 'Rules', 'Account', 'Decisions', 'Deps', 'Git', 'Svn', - 'Fossil', 'Bzr', 'Bundler', 'TGenshi', 'SGenshi', 'Base'] + 'Fossil', 'Bzr', 'Bundler', 'TGenshi', 'SGenshi', + 'Base'] def __init__(self, cfile): @@ -42,8 +45,9 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): opts, args = getopt.getopt(args, 'Hbko:', ['includehosts', 'includebundles', 'includekey', 'outfile=']) - except getopt.GetoptError, msg: - print msg + except getopt.GetoptError: + msg = sys.exc_info()[1] + print(msg) #FIXME: is this for --raw? #rset = False @@ -63,8 +67,8 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): data = self.Visualize(self.get_repo_path(), hset, bset, kset, outputfile) - print data - raise SystemExit, 0 + print(data) + raise SystemExit(0) def Visualize(self, repopath, hosts=False, bundles=False, key=False, output=False): @@ -82,7 +86,7 @@ class Viz(Bcfg2.Server.Admin.MetadataCore): try: dotpipe.stdin.write("digraph groups {\n") except: - print "write to dot process failed. Is graphviz installed?" + print("write to dot process failed. Is graphviz installed?") raise SystemExit(1) dotpipe.stdin.write('\trankdir="LR";\n') dotpipe.stdin.write(self.metadata.viz(hosts, bundles, |