B #6726: Fix CLI paramters converted wrongly to 0 id (#3287)

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 f5b2a17360)
This commit is contained in:
Pavel Czerný authored and Ruben S. Montero committed 2024-11-05 16:27:12 +01:00
1 parent d29681e60b
commit c24dff1d26
12 files changed
+93 -8

No files matched your search

+1 -1
View File
@@ -828,7 +828,7 @@ module CommandParser
end
def format_int(arg)
arg.match(/^\d+$/) ? [0,arg] : [-1]
arg.match(/^\d+$/) ? [0,arg] : [-1, "Argument '#{arg}' is not a valid ID"]
end
def format_file(arg)