summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Svn.py
diff options
context:
space:
mode:
authorJason Kincl <kincljc@ornl.gov>2013-06-14 10:02:48 -0400
committerJason Kincl <kincljc@ornl.gov>2013-06-17 10:14:56 -0400
commit98bfb01afb27cd0de0dac5c7a6190ac22fa1d0f3 (patch)
tree8b66614a556f5acb53a5bd3d6915f03e4fa84616 /src/lib/Bcfg2/Server/Plugins/Svn.py
parentc058c61d3358b2def1bb67ec18bfe632b0543751 (diff)
downloadbcfg2-98bfb01afb27cd0de0dac5c7a6190ac22fa1d0f3.tar.gz
bcfg2-98bfb01afb27cd0de0dac5c7a6190ac22fa1d0f3.tar.bz2
bcfg2-98bfb01afb27cd0de0dac5c7a6190ac22fa1d0f3.zip
Svn: Tidying up code and logging of subversion trust and user/pass options
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Svn.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Svn.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Svn.py b/src/lib/Bcfg2/Server/Plugins/Svn.py
index b7f4fec57..02656ffbe 100644
--- a/src/lib/Bcfg2/Server/Plugins/Svn.py
+++ b/src/lib/Bcfg2/Server/Plugins/Svn.py
@@ -63,31 +63,38 @@ class Svn(Bcfg2.Server.Plugin.Version):
if self.core.setup.cfp.get(
"svn",
"always_trust").lower() == "true":
- self.logger.info("Svn: Trust subversion SSL certificate")
self.client.callback_ssl_server_trust_prompt = \
self.ssl_server_trust_prompt
- except:
- pass
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+ self.logger.debug("Svn: Using subversion cache for SSL "
+ "certificate trust")
try:
- if self.core.setup.cfp.get("svn", "user") and \
- self.core.setup.cfp.get("svn", "password"):
- self.logger.info("Svn: Using user and password")
+ if (self.core.setup.cfp.get("svn", "user") and
+ self.core.setup.cfp.get("svn", "password")):
self.client.callback_get_login = \
self.get_login
- except:
- pass
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+ self.logger.info("Svn: Using subversion cache for "
+ "password-based authetication")
self.logger.debug("Svn: Initialized svn plugin with SVN directory %s" %
self.vcs_path)
def get_login(self, realm, username, may_save):
+ self.logger.debug("Svn: Logging in with username: %s" %
+ self.core.setup.cfp.get("svn", "user"))
return True, \
self.core.setup.cfp.get("svn", "user"), \
self.core.setup.cfp.get("svn", "password"), \
False
def ssl_server_trust_prompt(self, trust_dict):
+ self.logger.debug("Svn: Trusting SSL certificate from %s, "
+ "issued by %s for realm %s" %
+ (trust_dict['hostname'],
+ trust_dict['issuer_dname'],
+ trust_dict['realm']))
return True, trust_dict['failures'], False
def get_conflict_resolver(self, choice):