From 509183dfff11b1e15dac20e35876b54541a87d8d Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 14 Sep 2009 14:25:31 +0000 Subject: 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 git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5432 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Pull.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/Server/Admin/Pull.py') 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 -- cgit v1.2.3-1-g7c22