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

Some CLI commands accept name when they should not #6726

Closed
3 tasks
OpenNebulaSupport opened this issue Sep 16, 2024 · 1 comment · Fixed by OpenNebula/docs#3095
Closed
3 tasks

Some CLI commands accept name when they should not #6726

OpenNebulaSupport opened this issue Sep 16, 2024 · 1 comment · Fixed by OpenNebula/docs#3095

Comments

@OpenNebulaSupport
Copy link
Collaborator

Description
Certain CLI actions which required ID's will accept a name on the command line but when sent as an XML-RPC request to OpenNebula, the ID will be 0.

To Reproduce
Attempt to delete a zone host or another object which requests an ID only:

onezone server-del 0 server-name

This command is effectively the same as onezone server-del 0 0 even if server-name is host ID 4 or any non-zero ID.

Expected behavior
The command should either fail to accept a string for an ID or it should resolve the name to an ID properly.

Details

  • Affected Component: CLI
  • Version: 6.8.3

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
@paczerny
Copy link
Member

paczerny commented Nov 5, 2024

I've reviewed all one* commands, there are several parameters, which has the same issue:

  • schedid in onebackupjob
  • execid in onehook
  • snapshot_id in oneimage
  • nicid, pciid, sched_id and sgid in onevm
  • nicid in onevrouter
  • serverid in onezone

paczerny added a commit to OpenNebula/docs that referenced this issue Nov 5, 2024
rsmontero pushed a commit that referenced this issue Nov 7, 2024
These parameters were fixed:
* schedid in onebackupjob
* execid in onehook
* snapshot_id in oneimage
* nicid, pciid, sched_id and sgid in onevm
* nicid in onevrouter
* serverid in onezone

For all those parameters the string used as ID:
* if possible the name is converted is converted to int ID
* fails if the resource doesn't have name

(cherry picked from commit f5b2a173607e2f045ce3de95755828cef4bcca5b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment