Skip to content

Commit

Permalink
fix puppet agent test and backend_config type
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Aug 27, 2024
1 parent 7cb7e51 commit 7471291
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugins/modules/goss_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def main() -> None:
if gossfile != Path.cwd():
cwd = str(gossfile.parent)

# check on optionl upgrade param
# check on optional debug param
flags: list[str] = []
if module.params.get('debug'):
flags.append('debug')
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/packer_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def main() -> None:
var: list[dict] = module.params.get('var')
var_file: list[str] = module.params.get('var_file')

# check optionl params
# check optional params
flags: list[str] = []
if module.params.get('debug'):
flags.append('debug')
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/packer_fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def main() -> None:
check: bool = module.params.get('check')
config_dir: Path = Path(module.params.get('config_dir'))

# check optionl params
# check flags
flags: list[str] = []
if check:
flags.append('check')
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/packer_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main() -> None:
changed: bool = False
config_dir: Path = Path(module.params.get('config_dir'))

# check on optionl upgrade param
# check on optional upgrade param
flags: list[str] = []
if module.params.get('upgrade'):
flags.append('upgrade')
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/packer_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def main() -> None:
var: list[dict] = module.params.get('var')
var_file: list[str] = module.params.get('var_file')

# check optionl params
# check flags
flags: list[str] = []
if module.params.get('evaluate_datasources'):
flags.append('evaluate_datasources')
Expand All @@ -145,6 +145,7 @@ def main() -> None:
if not module.params.get('warn_undeclared_var'):
flags.append('no_warn_undeclared_var')

# check args
args: dict = {}
if len(excepts) > 0:
args.update({'excepts': excepts})
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/terraform_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ def main() -> None:

# initialize
changed: bool = False
backend_config: list[str] = module.params.get('backend_config')
backend_config: list[(str, dict[str, str])] = module.params.get('backend_config')
config_dir: Path = Path(module.params.get('config_dir'))
plugin_dir: list[str] = module.params.get('plugin_dir')

# check on optionl params
# check flags
flags: list[str] = []
if module.params.get('force_copy'):
flags.append('force_copy')
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/plugins/modules/test_puppet_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_puppet_agent_debug_noop_verbose(capfd):
info = json.loads(stdout)
assert not info['changed']
# sometimes stderr is empty on first execution for some reason
if info['stderr'].len() > 0:
if len(info['stderr']) > 0:
assert 'PID' in info['stderr']
assert 'agent' in info['command']
assert '-d' in info['command']
Expand Down

0 comments on commit 7471291

Please sign in to comment.