svn.export fails with module svn
State.sls
portage_checkout-portage3folder: svn.export:
- name: https://my-url/tags/1.2.3
- target: /target-folder
- overwrite: True
- force: True
- user: my-user
- username: my-username
- password: my-password
- trust: True
Output:
ID: XXX
Function: svn.export
Name: https://my-url/tags/1.2.3
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1533, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/states/svn.py", line 233, in export
out = __salt__[svn_cmd](cwd, name, basename, user, username, password, *opts)
File "/usr/lib/python2.7/dist-packages/salt/modules/svn.py", line 483, in export
return _run_svn('export', cwd, user, username, password, opts)
File "/usr/lib/python2.7/dist-packages/salt/modules/svn.py", line 75, in _run_svn
raise exceptions.CommandExecutionError(result['stderr'] + '\n\n' + cmd)
CommandExecutionError: svn: E205000: Syntax error in revision argument '--trust-server-cert'
svn --non-interactive export https://my-url/tags/1.2.3 target-folder -r --trust-server-cert --username my-username --password 'my-password'
Started: 15:02:42.521240
Duration: 127.799 ms
Changes:
Problem Analysis:
A 'rev' value is added to the opts list in the states/svn.py file in method svn.export. This list is then used in the corresponding modules/svn.py svn.export method to fill up the missing revision argument which has been introduced some point of time. This way, one of the opts parameters is taken as argument for the revision argument in the svn.export implementation.
There is no work around.
I already have a patch for that.
Version: salt-minion 2014.7.0 (Helium)
Fix /Pull Request created...
Actually the heading is wrong, it fails in states.svn in combination with the modules.svn... Modules.svn should work fine when used in isolation.
Thanks very much for the report and for the fix @RobertFach!
One Question: In which release will I see the fix? Thx
@RobertFach Since you made the change against the develop branch, as it stands right now, the fix won't be released until two feature releases away. However, I can mark this fix for backporting so it will be released in the next bug fix on the 2014.7 branch.
For future reference, we like to make bug fixes against the branch that has bug, and then we'll merge the fix forward in the the other branches. So in this case, since the bug exists on the 2014.7 branch, the fix would be made there, then we would merge that fix into 2015.2 and then develop, so the bug can be fixed on each branch. I'll backport this fix though, so no worries!
Thanks again for contributing and using salt! :)
@rallytime Okay, thx for the info and your support...
@RobertFach The backported pull request containing this fix will be available in the imminent 2014.7.1 release. If it's ok with you, I am going to close this ticket. If more needs to be fixed or discussed here, please leave a comment and we will be glad to re-visit this issue. Thanks again!