diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-09-14 14:25:31 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-09-14 14:25:31 +0000 |
commit | 509183dfff11b1e15dac20e35876b54541a87d8d (patch) | |
tree | a1e69ea440989a3d08da8564fd67bbeb98d2fa79 | |
parent | 78aa59d824454beacf68e3fc6914b39153372cc4 (diff) | |
download | bcfg2-509183dfff11b1e15dac20e35876b54541a87d8d.tar.gz bcfg2-509183dfff11b1e15dac20e35876b54541a87d8d.tar.bz2 bcfg2-509183dfff11b1e15dac20e35876b54541a87d8d.zip |
Pull.py: Fix traceback for ticket #731
While the pull mode of bcfg2-admin will not work unless a statistics
plugin is enabled, we should not allow it to traceback in the case a
user tries to call it without having one enabled.
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5432 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Server/Admin/Pull.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Admin/Pull.py b/src/lib/Server/Admin/Pull.py index 51672c912..81ae9c433 100644 --- a/src/lib/Server/Admin/Pull.py +++ b/src/lib/Server/Admin/Pull.py @@ -58,7 +58,12 @@ class Pull(Bcfg2.Server.Admin.MetadataCore): print "Pull Source failure; could not fetch current state" raise SystemExit(1) - data = {'owner':owner, 'group':group, 'perms':perms, 'text':contents} + try: + data = {'owner':owner, 'group':group, 'perms':perms, 'text':contents} + except UnboundLocalError: + print("Unable to build entry. " + "Do you have a statistics plugin enabled?") + raise SystemExit(1) for k, v in data.iteritems(): if v: new_entry[k] = v |