linode/linode-cli

image-upload fails with "Unknown command/action" since 5.9.0

major opened this issue · 3 comments

major commented

I recently install linode-cli 5.10.0 in Python 3.9.7 and I cannot use the image-upload action:

$ linode-cli image-upload --label fedora-35-beta --description fedora-35-beta --region us-central Fedora-Cloud-Base-35_Beta-1.2.x86_64.raw.gz 
Traceback (most recent call last):
  File "/home/major/venv/bin/linode-cli", line 8, in <module>
    sys.exit(main())
  File "/home/major/venv/lib/python3.9/site-packages/linodecli/__init__.py", line 407, in main
    plugins.invoke(parsed.command, plugin_args, context)
  File "/home/major/venv/lib/python3.9/site-packages/linodecli/plugins/__init__.py", line 33, in invoke
    plugin.call(args, context)
  File "/home/major/venv/lib/python3.9/site-packages/linodecli/plugins/image-upload.py", line 110, in call
    status, resp = context.client.call_operation("images", "upload", call_args)
  File "/home/major/venv/lib/python3.9/site-packages/linodecli/cli.py", line 591, in call_operation
    raise ValueError('Unknown command/action {}/{}'.format(command, action))
ValueError: Unknown command/action images/upload

I went back to 5.9.1 and 5.9.0 and had the same problem. Once I backed down to 5.8.2, it worked:

$ linode-cli image-upload --label fedora-35-beta --description fedora-35-beta --region us-central Fedora-Cloud-Base-35_Beta-1.2.x86_64.raw.gz 
The API responded with version 4.105.1, which is newer than the CLI's version of 4.102.0.  Please update the CLI to get access to the newest features.  You can update with a simple `pip install --upgrade linode-cli`
 |####################################################################################################| 100.0%
The API responded with version 4.105.1, which is newer than the CLI's version of 4.102.0.  Please update the CLI to get access to the newest features.  You can update with a simple `pip install --upgrade linode-cli`
┌──────────────────┬────────────────┬────────┬────────────────┬───────────┬──────┬────────────────┐
│ id               │ label          │ vendor │ description    │ is_public │ size │ status         │
├──────────────────┼────────────────┼────────┼────────────────┼───────────┼──────┼────────────────┤
│ private/14117297 │ fedora-35-beta │ None   │ fedora-35-beta │ False     │ 0    │ pending_upload │
└──────────────────┴────────────────┴────────┴────────────────┴───────────┴──────┴────────────────┘

Thanks for the report, I'm looking at this now

It looks like the spec began omitting the images/upload operation from the CLI, which broke this plugin. I've put up a PR against the spec to reintroduce it, which should fix the plugin as well. I'll update this issue when the fix ships (and consider expanding tests to cover CLI plugins, which today they do not).

major commented

It looks like the spec began omitting the images/upload operation from the CLI, which broke this plugin. I've put up a PR against the spec to reintroduce it, which should fix the plugin as well. I'll update this issue when the fix ships (and consider expanding tests to cover CLI plugins, which today they do not).

Thanks for the quick reply!