Revision b0ddfd38 src/cli/onetemplate
src/cli/onetemplate | ||
---|---|---|
195 | 195 |
* unpublish (Unpublish an Template) |
196 | 196 |
onetemplate unpublish <template_id> |
197 | 197 |
|
198 |
* chown (Changes the Template owner and group) |
|
199 |
onetemplate chown <template_id> <owner_id> [<group_id>] |
|
200 |
|
|
201 |
* chgrp (Changes the Template group) |
|
202 |
onetemplate chgrp <template_id> <group_id> |
|
203 |
|
|
198 | 204 |
* list (Shows Templates in the pool) |
199 | 205 |
onetemplate list <filter_flag> |
200 | 206 |
|
... | ... | |
337 | 343 |
puts "Template unpublished" if ops[:verbose] |
338 | 344 |
end |
339 | 345 |
|
346 |
when "chown" |
|
347 |
check_parameters("chown", 2) |
|
348 |
|
|
349 |
obj_id = get_template_id(ARGV[0]) |
|
350 |
new_uid = ARGV[1].to_i |
|
351 |
new_gid = ( ARGV.length > 2 ) ? ARGV[2].to_i : -1 |
|
352 |
|
|
353 |
obj = OpenNebula::Template.new_with_id(obj_id, get_one_client) |
|
354 |
|
|
355 |
result = obj.chown( new_uid, new_gid ) |
|
356 |
if is_successful?(result) |
|
357 |
puts "Template user/group changed" if ops[:verbose] |
|
358 |
end |
|
359 |
|
|
360 |
when "chgrp" |
|
361 |
check_parameters("chgrp", 2) |
|
362 |
|
|
363 |
obj_id = get_template_id(ARGV[0]) |
|
364 |
new_uid = -1 |
|
365 |
new_gid = ARGV[1].to_i |
|
366 |
|
|
367 |
obj = OpenNebula::Template.new_with_id(obj_id, get_one_client) |
|
368 |
|
|
369 |
result = obj.chown( new_uid, new_gid ) |
|
370 |
if is_successful?(result) |
|
371 |
puts "Template group changed" if ops[:verbose] |
|
372 |
end |
|
373 |
|
|
340 | 374 |
when "list" |
341 | 375 |
ops.merge!(get_user_flags) |
342 | 376 |
if !ops[:xml] |
Also available in: Unified diff