Skip to content

Commit cea24c5

Browse files
pb8obchalios
authored andcommitted
ci: fix passing simple values to step parameters
In c6add4f while adding support for more complex parameters we broke passing simple strings. While it can be worked around by quoting the string with '', that makes the simple case more complex than it was before, and breaks previous pipeline definitions. Fix it so if the first character does not look like a python expression, take the value verbatim. Fixes: c6add4f Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 11d8a01 commit cea24c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.buildkite/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def __call__(self, parser, namespace, value, option_string=None):
139139
res = getattr(namespace, self.dest, {})
140140
key_str, val = value.split("=", maxsplit=1)
141141
keys = key_str.split("/")
142-
update = {keys[-1]: ast.literal_eval(val)}
142+
# Interpret it as a literal iff it starts like one
143+
update = {keys[-1]: ast.literal_eval(val) if val[0] in "[{'" else val}
143144
for key in list(reversed(keys))[1:]:
144145
update = {key: update}
145146
res = overlay_dict(res, update)

0 commit comments

Comments
 (0)