Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make python's get_octopusvariable return empty string if not existing #1043

Merged
merged 1 commit into from
May 28, 2023

Conversation

mik-ky
Copy link
Contributor

@mik-ky mik-ky commented May 25, 2023

Python and bash have different behaviours with get_octopusvariable; If the variable doesn't exist, bash will return an empty string whereas python will throw an error, failing the script.

To replicate, use the following scripts for Run a Script:

# python script
print("Color from pound-braces #{Color}")
print("Color from get_octopusvariable "+get_octopusvariable("Color"))
# bash script
echo "Color from pound-braces #{Color}"
echo "Get Octopus Variable for Color: " $(get_octopusvariable "Color")

This is a simple fix to make the behaviour consistent in python. Related: #217

[sc-49511]

Before
image

After
image

@shortcut-integration
Copy link

@mik-ky mik-ky merged commit b172225 into master May 28, 2023
51 checks passed
@mik-ky mik-ky deleted the chrisk/python-get-octovar-consistency branch May 28, 2023 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants