Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #23285 #24291

Merged
merged 1 commit into from May 4, 2017
Merged

Fixes #23285 #24291

merged 1 commit into from May 4, 2017

Conversation

dsummersl
Copy link
Contributor

Makes subversion module --check fail when modified files are in
repository.

SUMMARY

Checks that there are no local file modifications in the repository in check_mode (as long as force is also False).

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

subversion module

ANSIBLE VERSION
ansible 2.4.0 (issue-23285 0e02463a88) last updated 2017/05/04 07:58:25 (GMT -400)
  config file =
  configured module search path = [u'/Users/---/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/---/Documents/classes/ansible/lib/ansible
  executable location = /Users/---/Documents/classes/ansible/bin/ansible
  python version = 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
ADDITIONAL INFORMATION

When the target host has a modified file in its repository it DOES NOT fail check mode. This fixes that issue.

Here I have setup a target with a subversion repository with a local modification (removed file).

# before change:
cat s.yml
---
- hosts: docker
  become: true
  tasks:
  - name: break subversion
    subversion:
      repo: file:///svnrepos/testproject
      dest: /root/svnrepo

ansible-playbook -i test_hosts s.yml --check
PLAY [docker] ********************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************
ok: [docker]

TASK [break subversion] **********************************************************************************************************************************************************
ok: [docker]

PLAY RECAP ***********************************************************************************************************************************************************************
docker                     : ok=2    changed=0    unreachable=0    failed=0

# this change:
cat s.yml
---
- hosts: docker
  become: true
  tasks:
  - name: break subversion
    subversion:
      repo: file:///svnrepos/testproject
      dest: /root/svnrepo

ansible-playbook -i test_hosts s.yml --check
PLAY [docker] ********************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************
ok: [docker]

TASK [break subversion] **********************************************************************************************************************************************************
fatal: [docker]: FAILED! => {"changed": false, "failed": true, "msg": "ERROR: modified files exist in the repository."}
        to retry, use: --limit @/Users/danesummers/Documents/classes/ansible/s.retry

PLAY RECAP ***********************************************************************************************************************************************************************
docker                     : ok=1    changed=0    unreachable=0    failed=1

# this change - with a playbook using subversion 'force' option.
cat s-force.yml
---
- hosts: docker
  become: true
  tasks:
  - name: break subversion
    subversion:
      repo: file:///svnrepos/testproject
      dest: /root/svnrepo
      force: true

ansible-playbook -i test_hosts s-force.yml --check
PLAY [docker] ********************************************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************************************
ok: [docker]

TASK [break subversion] **********************************************************************************************************************************************************
ok: [docker]

PLAY RECAP ***********************************************************************************************************************************************************************
docker                     : ok=2    changed=0    unreachable=0    failed=0

Makes subversion module --check fail when modified files are in
repository.
@dsummersl dsummersl changed the title Fixes #23385 Fixes #23285 May 4, 2017
@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bugfix_pull_request core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. owner_pr This PR is made by the module's maintainer. labels May 4, 2017
@nitzmahone nitzmahone removed the needs_triage Needs a first human triage before being processed. label May 4, 2017
@nitzmahone nitzmahone merged commit 4bd04c2 into ansible:devel May 4, 2017
nitzmahone pushed a commit that referenced this pull request May 4, 2017
Makes subversion module --check fail when modified files are in
repository.
(cherry picked from commit 4bd04c2)
@nitzmahone
Copy link
Member

cherry-picked to stable-2.3 for 2.3.1RC1

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. owner_pr This PR is made by the module's maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants