Skip to content

Commit

Permalink
Properly set multiline custom CA Bundle
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Podhradsky <apodhrad@redhat.com>
  • Loading branch information
apodhrad committed May 9, 2024
1 parent dc71d15 commit 7596cd4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ods_ci/libs/Helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,13 @@ def is_string_empty(self, string):
SyntaxError: EOL while scanning string literal (<string>, line 1)
"""
return string is None or string == ""

@keyword
def multiline_to_oneline_string(self, multiline_string, delimeter=" "):
"""
Converts a mutliline string into a oneline string with a provided delimeter.
Robot Framework doesn't properly handle multi-line strings and throws
Evaluating expression '"...".replace('', '\n')' failed:
SyntaxError: unterminated string literal (detected at line 1) (<string>, line 1)
"""
return multiline_string.replace("\n", delimeter)
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Check ConfigMap Contains CA Bundle Key
Set Custom CA Bundle Value In DSCI
[Documentation] Set Custom CA Bundle value in DSCI
[Arguments] ${DSCI} ${custom_ca_bundle_value} ${namespace}
${custom_ca_bundle_value}= Multiline To Oneline String ${custom_ca_bundle_value} \\n
${rc} ${output}= Run And Return Rc And Output
... oc patch DSCInitialization/${DSCI} -n ${namespace} -p '{"spec":{"trustedCABundle":{"customCABundle":"${custom_ca_bundle_value}"}}}' --type merge
Should Be Equal "${rc}" "0" msg=${output}
Expand Down

0 comments on commit 7596cd4

Please sign in to comment.