Skip to content

Commit badaaf9

Browse files
committed
update GoSS format and Packer on_error validations
1 parent 8545979 commit badaaf9

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### 1.3.2 (Next)
22
- Miscellaneous minor Terraform module plugin fixes.
33
- Minor documentation corrections.
4+
- Update GoSS `format` and Packer `on_error` validations.
45

56
### 1.3.1
67
- Improve accuracy of `default` in plugin documentation.

plugins/module_utils/goss.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def cmd(action: str, flags: set[str] = set(), args: dict[str, str | int | dict]
6868
elif arg == 'format' and arg_value not in [
6969
'documentation',
7070
'json',
71-
'json_oneline',
7271
'junit',
7372
'nagios',
7473
'prometheus',

plugins/module_utils/packer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def cmd(action: str, flags: set[str] = set(), args: dict[str, str | int | list[s
6565
# note for next two conditionals second logical tests for whether str or list is expected based on pseudo-schema in ARGS_MAP
6666
# if the arg value is a str, then append the value interpolated with the arg name from the dict to the command
6767
if (isinstance(arg_value, str) or isinstance(arg_value, bool)) and len(action_args_map[arg]) > 0:
68+
# validate on_error arg value
69+
if arg == 'on_error' and arg_value not in ['cleanup', 'abort', 'ask', 'run-cleanup-provisioner']:
70+
raise RuntimeError(f'Unsupported on error argument value specified: {arg_value}')
71+
6872
command.append(f'{action_args_map[arg]}{arg_value}')
6973
# if the arg value is a list, then extend the command with the values because they are already formatted correctly
7074
elif isinstance(arg_value, list) and len(action_args_map[arg]) == 0:

0 commit comments

Comments
 (0)