summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Svn.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 08:19:09 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 08:19:09 -0400
commit317d3087459538877100032733477362f456f550 (patch)
tree27fabdff3649c75bcdd9de8ccde5c5826c679e5e /src/lib/Bcfg2/Server/Plugins/Svn.py
parent9d5e8170292e17d3b087878918562dcf502f70d4 (diff)
parenta519dc9298317b678bca43597892df5aa13d874d (diff)
downloadbcfg2-317d3087459538877100032733477362f456f550.tar.gz
bcfg2-317d3087459538877100032733477362f456f550.tar.bz2
bcfg2-317d3087459538877100032733477362f456f550.zip
Merge branch 'maint'
Conflicts: doc/server/plugins/generators/cfg.txt doc/server/plugins/generators/tcheetah.txt src/lib/Bcfg2/Server/Admin/Xcmd.py src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Svn.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Svn.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Svn.py b/src/lib/Bcfg2/Server/Plugins/Svn.py
index 34a6e89e0..dfe864d48 100644
--- a/src/lib/Bcfg2/Server/Plugins/Svn.py
+++ b/src/lib/Bcfg2/Server/Plugins/Svn.py
@@ -60,9 +60,48 @@ class Svn(Bcfg2.Server.Plugin.Version):
self.client.callback_conflict_resolver = \
self.get_conflict_resolver(choice)
+ try:
+ if self.core.setup.cfp.get(
+ "svn",
+ "always_trust").lower() == "true":
+ self.client.callback_ssl_server_trust_prompt = \
+ self.ssl_server_trust_prompt
+ 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.client.callback_get_login = \
+ self.get_login
+ 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)
+ # pylint: disable=W0613
+ def get_login(self, realm, username, may_save):
+ """ PySvn callback to get credentials for HTTP basic authentication """
+ 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
+ # pylint: enable=W0613
+
+ def ssl_server_trust_prompt(self, trust_dict):
+ """ PySvn callback to always trust SSL certificates from SVN server """
+ 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):
""" Get a PySvn conflict resolution callback """
def callback(conflict_description):