mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-22 12:50:42 +00:00
rename and fix rule CheckFilePermissionMissing
This commit is contained in:
parent
bf3908ac36
commit
6f2a06357f
@ -20,7 +20,7 @@
|
|||||||
from ansiblelater.standard import StandardBase
|
from ansiblelater.standard import StandardBase
|
||||||
|
|
||||||
|
|
||||||
class CheckMissingFilePermission(StandardBase):
|
class CheckFilePermissionMissing(StandardBase):
|
||||||
|
|
||||||
sid = "ANSIBLE0018"
|
sid = "ANSIBLE0018"
|
||||||
description = "File permissions unset or incorrect"
|
description = "File permissions unset or incorrect"
|
||||||
@ -55,7 +55,7 @@ class CheckMissingFilePermission(StandardBase):
|
|||||||
|
|
||||||
if not errors:
|
if not errors:
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
if not self._check_mode(task):
|
if self._check_mode(task):
|
||||||
errors.append(
|
errors.append(
|
||||||
self.Error(
|
self.Error(
|
||||||
task["__line__"],
|
task["__line__"],
|
||||||
@ -82,7 +82,7 @@ class CheckMissingFilePermission(StandardBase):
|
|||||||
create = task["action"].get("create", self._create_modules[module])
|
create = task["action"].get("create", self._create_modules[module])
|
||||||
return create and mode is None
|
return create and mode is None
|
||||||
|
|
||||||
# A file that doesn"t exist cannot have a mode
|
# A file that doesn't exist cannot have a mode
|
||||||
if task["action"].get("state", None) == "absent":
|
if task["action"].get("state", None) == "absent":
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -95,8 +95,7 @@ class CheckMissingFilePermission(StandardBase):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# The file module does not create anything when state==file (default)
|
# The file module does not create anything when state==file (default)
|
||||||
if module == "file" and \
|
if module == "file" and task["action"].get("state", "file") == "file":
|
||||||
task["action"].get("state", "file") == "file":
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# replace module is the only one that has a valid default preserve
|
# replace module is the only one that has a valid default preserve
|
Loading…
Reference in New Issue
Block a user