Skip to content

Commit

Permalink
Fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed May 21, 2021
1 parent 9b72428 commit 57438a0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/ansiblelint/rules/MissingFilePermissionsRule.py
Expand Up @@ -186,6 +186,15 @@ def matchtask(
file:
state: directory
recurse: yes
- name: permissions not missing and numeric (fqcn)
ansible.builtin.file:
path: bar
mode: 755
- name: file edit when create is false (fqcn)
ansible.builtin.lineinfile:
path: foo
create: false
line: some content here
'''

FAIL_PRESERVE_MODE = '''
Expand Down Expand Up @@ -232,6 +241,14 @@ def matchtask(
replace:
path: foo
mode: preserve
- name: permissions are missing (fqcn)
ansible.builtin.file:
path: bar
- name: lineinfile when create is true (fqcn)
ansible.builtin.lineinfile:
path: foo
create: true
line: some content here
'''

FAIL_PERMISSION_COMMENT = '''
Expand Down Expand Up @@ -359,7 +376,7 @@ def test_fail_lineinfile_create(rule_runner: Any) -> None:
def test_fail_replace_preserve(rule_runner: Any) -> None:
"""Replace does not allow preserve mode."""
results = rule_runner.run_playbook(FAIL_REPLACE_PRESERVE)
assert len(results) == 1
assert len(results) == 3

@pytest.mark.parametrize(
'rule_runner', (MissingFilePermissionsRule,), indirect=['rule_runner']
Expand Down

0 comments on commit 57438a0

Please sign in to comment.