Revision b0ddfd38 src/cli/oneimage

View differences:

src/cli/oneimage
254 254

  
255 255
* nonpersistent (Makes an Image non persistent)
256 256
    oneimage nonpersistent <image_id>
257
    
257

  
258
* chown (Changes the Image owner and group)
259
    oneimage chown <image_id> <owner_id> [<group_id>]
260

  
261
* chgrp (Changes the Image group)
262
    oneimage chgrp <image_id> <group_id>
263

  
258 264
* list (Shows Images in the pool)
259 265
    oneimage list <filter_flag>
260 266
    
......
440 446
    if is_successful?(result)
441 447
        puts "Image made nonpersistent" if ops[:verbose]
442 448
    end
443
    
449

  
450
when "chown"
451
    check_parameters("chown", 2)
452

  
453
    image_id = get_image_id(ARGV[0])
454
    new_uid  = ARGV[1].to_i
455
    new_gid = ( ARGV.length > 2 ) ? ARGV[2].to_i : -1
456

  
457
    image = OpenNebula::Image.new_with_id(image_id, get_one_client)
458

  
459
    result = image.chown( new_uid, new_gid )
460
    if is_successful?(result)
461
        puts "Image user/group changed" if ops[:verbose]
462
    end
463

  
464
when "chgrp"
465
    check_parameters("chgrp", 2)
466

  
467
    image_id = get_image_id(ARGV[0])
468
    new_uid  = -1
469
    new_gid  = ARGV[1].to_i
470

  
471
    image = OpenNebula::Image.new_with_id(image_id, get_one_client)
472

  
473
    result = image.chown( new_uid, new_gid )
474
    if is_successful?(result)
475
        puts "Image group changed" if ops[:verbose]
476
    end
477

  
444 478
when "list"
445 479
    ops.merge!(get_user_flags)
446 480
    if !ops[:xml]

Also available in: Unified diff