Skip to content

Prevents SLCLI_VERSION environment variable from breaking things #1527

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

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

allmightyspiff
Copy link
Member

Fixes #1524

Apparently Click has a neat feature that allows you to set parameters with environment variables, which I just learned about.
https://github.com/softlayer/softlayer-python/blame/master/SoftLayer/CLI/core.py#L103 is what actually controls that, but since its been active for 3 years, I don't really want to turn it off entirely, as it is a somewhat neat feature.

So I'll just turn it off for --version which I don't think anyone would want to have automatically be set.

@allmightyspiff allmightyspiff requested a review from caberos August 2, 2021 21:06
@allmightyspiff allmightyspiff self-assigned this Aug 2, 2021
@allmightyspiff
Copy link
Member Author

Also updated the snapcraft release build to have a unique name since I want to use release for something else in the future.
Updated the README to highlight the environment variable feature.

Copy link
Contributor

@caberos caberos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

Testing
slcli --version
Current: slcli (SoftLayer Command-line) v5.9.5
Latest: slcli (SoftLayer Command-line) v5.9.6

slcli -v
Usage: slcli [OPTIONS] COMMAND [ARGS]...
Try "slcli -h" for help.

Error: Missing command.

slcli -v vs list
Calling: SoftLayer_Account::getVirtualGuests(id=None, mask='primaryIpAddress, activeTransaction[ id,transactionStatus[name,friendlyName] ],hostname,datacenter.name,id,primaryBackendIpAddress', filter='{}', args=(), limit=100, offset=0))

@caberos caberos self-requested a review August 3, 2021 19:02
@allmightyspiff allmightyspiff merged commit 5dde6fa into softlayer:master Aug 3, 2021
@allmightyspiff allmightyspiff deleted the issues1524 branch August 3, 2021 20:43
@allmightyspiff allmightyspiff mentioned this pull request Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: Invalid value for '--version': '5.9.6' is not a valid boolean.
2 participants