svn.export halts if file exists
I'm getting hung up on https://github.com/saltstack/salt/blob/develop/salt/states/svn.py#L200-L204
Essentially I want to grab a file from svn no matter what, even if the file/dir exists. I thought using force would allow me to do this, but it looks like I would have to use a cmd.run to remove the file so this doesn't fail.
Is this a bug? Or is my use case just different than intended? I'd like to be able to override this check some how. What do you think?
That does seem like a bug to me. I would probably want it to compare to the version in SVN to make sure I have the most up-to-date version.
Well, export should always give you the latest version it has. I think just having "overwrite" flag would be safe and explicit.
In the interim I am using this macro to get around this.
{% macro svn_export(source,dest) -%}
{{ dest }}:
cmd.run:
- name: rm {{ dest }}
- onlyif: |
[ -f {{ dest }} ]
svn.export:
- name: svn+ssh://localhost/{{ source }}
- target: {{ dest }}
- force: True
- require:
- cmd: {{ dest }}
{% endmacro -%}
So I've submitted a PR for what makes sense to me. Please comment :)
Awesome, looks great!