Use pre-commit with black + yamllint
* Added pre-commit config * Added yamllint config * Updated example YAML files to match the yamllint config * black'd existing Python code
This commit is contained in:
parent
7ea55e277e
commit
4a56566c58
6 changed files with 100 additions and 34 deletions
inventory_plugins
|
@ -893,11 +893,7 @@ class RciBlock(RcInstruction):
|
|||
output.extend(" " + s for s in instr.dump())
|
||||
|
||||
def parse_action(self, record):
|
||||
assert (
|
||||
self._block is None
|
||||
and self._rescue is None
|
||||
and self._always is None
|
||||
)
|
||||
assert self._block is None and self._rescue is None and self._always is None
|
||||
if "block" not in record:
|
||||
raise AnsibleParserError("%s: missing 'block' field" % (self._action,))
|
||||
self._block = self.parse_block(record, "block")
|
||||
|
@ -938,11 +934,7 @@ class RciBlock(RcInstruction):
|
|||
return instructions
|
||||
|
||||
def execute_action(self, host_name, variables):
|
||||
assert not (
|
||||
self._block is None
|
||||
or self._rescue is None
|
||||
or self._always is None
|
||||
)
|
||||
assert not (self._block is None or self._rescue is None or self._always is None)
|
||||
try:
|
||||
try:
|
||||
self._display.vvv("- running 'block' instructions")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue