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

[Feature]: Config based "--suppress-warnings" or, more specifically, quiet version mismatch warning #582

Open
bnjmn opened this issue Feb 22, 2024 · 1 comment
Labels
enhancement issues that request a enhancement

Comments

@bnjmn
Copy link

bnjmn commented Feb 22, 2024

Description (Problem / Annoyance)

Calling linode-cli without --suppress-warnings will almost always output a version mismatch warning at the rate this library changes. Using linode-cli in scripts requires adding this argument to every call; or get noisy version mismatch messages in logs that are not really helpful for automated processes.

Proposal

This flag setting should be configurable via ./config/linode-cli or an ENV VAR (or both ideally).

  • this could be for suppressing all warnings, as it is
  • OR, specifically suppressing the version mismatch warning may also be desirable (seems to be the only one that is quite noisy)
  • OR both, for example (naming tbd)
    • LINODE_CLI_SUPPRESS_WARNINGS (would suppress all)
    • LINODE_CLI_SUPPRESS_VERSION_WARNING (just the version mismatch)

References

Here is the code where the warning is generated.

Example usage currently relying on sys.argv instead of CLI.suppress_warnings (here)

Extra

I could potentially help out with this if it is something that the community/maintainers are open to.

Potential Usage Example

linode-cli account view
The API responded with version 4.173.0, which is newer than the CLI's version of 4.170.2.  Please update the CLI to get access to the newest features.  You can update with a simple `pip3 install --upgrade linode-cli`
┌────────────┬───────────┬──────────────────────┬─────────┬────────────────────┐
│ first_name │ last_name │ email                │ balance │ balance_uninvoiced │
├────────────┼───────────┼──────────────────────┼─────────┼────────────────────┤
│ Larry      │ Linode    │ linode@linode.com    │ 0.0     │ 1,000,000.00       │
└────────────┴───────────┴──────────────────────┴─────────┴────────────────────┘


export LINODE_CLI_SUPPRESS_VERSION_WARNING=true 
linode-cli account view
┌────────────┬───────────┬──────────────────────┬─────────┬────────────────────┐
│ first_name │ last_name │ email                │ balance │ balance_uninvoiced │
├────────────┼───────────┼──────────────────────┼─────────┼────────────────────┤
│ Larry      │ Linode    │ linode@linode.com    │ 0.0     │ 1,000,000.00       │
└────────────┴───────────┴──────────────────────┴─────────┴────────────────────┘

Or this could be something like this in linode-cli config

[DEFAULT]
default-user = DEFAULT
region = us-southeast
type = g6-standard-2
suppress-warnings = false
suppress-version-warning = true
@bnjmn bnjmn added the enhancement issues that request a enhancement label Feb 22, 2024
@yec-akamai
Copy link
Contributor

@bnjmn Thank you for the feature request! We've made an internal ticket to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement issues that request a enhancement
Projects
None yet
Development

No branches or pull requests

2 participants