summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Core.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-06-30 15:21:33 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-06-30 15:21:33 +0000
commitf742102d4da79d320c55bcdfa599fb00763ae541 (patch)
tree6a74c94efbaed56af26a52006ec242faa8348657 /src/lib/Server/Core.py
parentb6abd64675d8debff887da53b623410466f552e1 (diff)
downloadbcfg2-f742102d4da79d320c55bcdfa599fb00763ae541.tar.gz
bcfg2-f742102d4da79d320c55bcdfa599fb00763ae541.tar.bz2
bcfg2-f742102d4da79d320c55bcdfa599fb00763ae541.zip
Fix revision handing code when things don't work
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1906 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Core.py')
-rw-r--r--src/lib/Server/Core.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 8fb50ba12..e417f9aa0 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -204,12 +204,12 @@ class Core(object):
self.cron = {}
self.setup = setup
self.plugins = {}
+ self.revision = '-1'
try:
self.svn = cfile.get('server', 'svn') == 'yes'
self.read_svn_revision()
except:
self.svn = False
- self.revision = '-1'
mpath = cfile.get('server','repository')
try:
@@ -316,9 +316,11 @@ class Core(object):
def read_svn_revision(self):
'''Read svn revision information for the bcfg2 repository'''
try:
- revline = [line.split(': ')[1].strip() for line in os.popen("svn info %s" % (self.datastore)).readlines() if
- line[:9] == 'Revision:'][-1]
+ data = os.popen("svn info %s" % (self.datastore)).readlines()
+ revline = [line.split(': ')[1].strip() for line in data if line[:9] == 'Revision:'][-1]
self.revision = revline
except IndexError:
logger.error("Failed to read svn info; disabling svn support")
+ logger.error('''Ran command "svn info %s"''' % (self.datastore))
+ logger.error("Got output: %s" % data)
self.svn = False