summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-03-30 16:20:07 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-03-30 16:20:07 +0000
commitdc4a28c0bb59edc9385d6860ed1b7defeeacde42 (patch)
tree2051262de083cfe147e3a076c3db50e54d4d8656
parent316ecf6348a1e80a50b0909d9b95a2678f3ea3af (diff)
downloadbcfg2-dc4a28c0bb59edc9385d6860ed1b7defeeacde42.tar.gz
bcfg2-dc4a28c0bb59edc9385d6860ed1b7defeeacde42.tar.bz2
bcfg2-dc4a28c0bb59edc9385d6860ed1b7defeeacde42.zip
* Add error handling for svn revision check
* Add documentation to the bcfg2.conf man page git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1823 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--man/bcfg2.conf.52
-rw-r--r--src/lib/Server/Core.py13
2 files changed, 11 insertions, 4 deletions
diff --git a/man/bcfg2.conf.5 b/man/bcfg2.conf.5
index f049f6994..feebcb05a 100644
--- a/man/bcfg2.conf.5
+++ b/man/bcfg2.conf.5
@@ -14,6 +14,8 @@ structures=list of enabled structures
.TP
bundles=list of enabled bundles
.TP
+svn=(yes|no) (Repository is svn managed)
+.TP
.B [communication]
.TP
password=communication password
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 7820cfca4..a1c9db9eb 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -206,9 +206,10 @@ class Core(object):
self.plugins = {}
try:
self.svn = cfile.get('server', 'svn') == 'yes'
+ self.read_svn_revision()
except:
self.svn = False
- self.revision = '-1'
+ self.revision = '-1'
mpath = cfile.get('server','repository')
try:
@@ -314,6 +315,10 @@ class Core(object):
def read_svn_revision(self):
'''Read svn revision information for the bcfg2 repository'''
- revline = [line.split(': ')[1].strip() for line in os.popen("svn info %s" % (self.datastore)).readlines() if
- line[:9] == 'Revision:'][-1]
- self.revision = revline
+ try:
+ revline = [line.split(': ')[1].strip() for line in os.popen("svn info %s" % (self.datastore)).readlines() if
+ line[:9] == 'Revision:'][-1]
+ self.revision = revline
+ except IndexError:
+ logger.error("Failed to read svn info; disabling svn support")
+ self.svn = False