From 7f79ff732f56e884012feab66575b8f21a25f97b Mon Sep 17 00:00:00 2001 From: Ben Hosmer Date: Tue, 10 Sep 2013 08:27:46 -0400 Subject: [PATCH] Add option to allow SVN to trust server identity. --- salt/states/svn.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/salt/states/svn.py b/salt/states/svn.py index 9b055c7865..59ab2cca7f 100644 --- a/salt/states/svn.py +++ b/salt/states/svn.py @@ -38,7 +38,8 @@ def latest(name, username=None, password=None, force=False, - externals=True): + externals=True, + trust=False): ''' Checkout or update the working directory to the latest revision from the remote repository. @@ -69,6 +70,9 @@ def latest(name, externals : True Change to False to not checkout or update externals + + trust : False + Automatically trust the remote server. SVN's --trust-server-cert ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} if not target: @@ -109,6 +113,9 @@ def latest(name, if externals is False: opts += ('--ignore-externals',) + if trust: + opts += ('--trust-server-cert',) + if svn_cmd == 'svn.update': out = __salt__[svn_cmd](cwd, basename, user, username, password, *opts) @@ -121,8 +128,9 @@ def latest(name, fmt='dict')[0]['Revision'] if current_rev != new_rev: ret['changes']['revision'] = "{0} => {1}".format(current_rev, new_rev) + else: - out = __salt__[svn_cmd](cwd, name, basename, user, username, password, *opts) + out = __salt__[svn_cmd](cwd, name, basename, user, username, password, trus, *opts) ret['changes']['new'] = name ret['changes']['revision'] = __salt__['svn.info'](cwd=target,