Skip to content

Commit 1bad635

Browse files
pb8okalyazin
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 (cherry picked from commit cea24c5) Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent e2035b4 commit 1bad635

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
@@ -134,7 +134,8 @@ def __call__(self, parser, namespace, value, option_string=None):
134134
res = getattr(namespace, self.dest, {})
135135
key_str, val = value.split("=", maxsplit=1)
136136
keys = key_str.split("/")
137-
update = {keys[-1]: ast.literal_eval(val)}
137+
# Interpret it as a literal iff it starts like one
138+
update = {keys[-1]: ast.literal_eval(val) if val[0] in "[{'" else val}
138139
for key in list(reversed(keys))[1:]:
139140
update = {key: update}
140141
res = overlay_dict(res, update)

0 commit comments

Comments
 (0)