summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-admin
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-07-21 01:12:32 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-07-21 01:12:32 +0000
commitcb7528b6e1a58fa7272e81e91d5c339e07bd2223 (patch)
treef0aecc8f568caa8782c021284a6fa0608683f76e /src/sbin/bcfg2-admin
parente9721c26e016a2cbbf3637e850d4d11ef6c463cb (diff)
downloadbcfg2-cb7528b6e1a58fa7272e81e91d5c339e07bd2223.tar.gz
bcfg2-cb7528b6e1a58fa7272e81e91d5c339e07bd2223.tar.bz2
bcfg2-cb7528b6e1a58fa7272e81e91d5c339e07bd2223.zip
Improve error handling in bcfg2-admin (Step towards resolving Ticket #469)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3527 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-admin')
-rwxr-xr-xsrc/sbin/bcfg2-admin9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin
index 05c51c3bc..d1bfff7b5 100755
--- a/src/sbin/bcfg2-admin
+++ b/src/sbin/bcfg2-admin
@@ -3,7 +3,7 @@
import getopt, difflib, logging, lxml.etree, os, popen2, re, socket, sys, ConfigParser
import Bcfg2.Server.Core, Bcfg2.Logging, Bcfg2.tlslite.api
-import xml.sax.saxutils
+import xml.sax.saxutils, binascii
log = logging.getLogger('bcfg-admin')
@@ -313,7 +313,10 @@ def do_pull(cfile, repopath, client, etype, ename):
if not entry:
err_exit("Could not find state data for entry; rerun bcfg2 on client system")
- diff = entry[0].get('current_diff')
+ if 'current_bdiff' in entry[0].attrib:
+ diff = binascii.a2b_base64(entry[0].get('current_bdiff'))
+ else:
+ diff = entry[0].get('current_diff')
try:
bcore = Bcfg2.Server.Core.Core({}, cfile)
@@ -331,6 +334,8 @@ def do_pull(cfile, repopath, client, etype, ename):
err_exit("Got wrong numbers of matching generators for entry:" \
+ "%s" % ([g.__name__ for g in glist]))
plugin = glist[0]
+ if diff == None:
+ err_exit("Failed to locate diff\nStatistics entry was:\n%s" % lxml.etree.tostring(entry[0]))
try:
plugin.AcceptEntry(m, 'ConfigFile', ename, diff)
except Bcfg2.Server.Plugin.PluginExecutionError: