@@ -29,11 +29,20 @@ def cli(env, name, public):
2929 for image in image_mgr .list_public_images (name = name , mask = image_mod .MASK ):
3030 images .append (image )
3131
32- table = formatting .Table (['id' , 'name' , 'type' , 'visibility' , 'account' ])
32+ table = formatting .Table (['Id' , 'Name' , 'Type' , 'Visibility' , 'Account' , 'OS' , 'Created' , 'Notes' ])
33+ table .align ['OS' ] = 'l'
34+ table .align ['Notes' ] = 'l'
3335
3436 images = [image for image in images if not image ['parentId' ]]
3537 for image in images :
36-
38+ operative_system = '-'
39+ if image .get ('children' ) and len (image .get ('children' )) != 0 :
40+ if image .get ('children' )[0 ].get ('blockDevices' ) and len (image .get ('children' )[0 ].get ('blockDevices' )) != 0 :
41+ for block_device in image .get ('children' )[0 ].get ('blockDevices' ):
42+ if block_device .get ('diskImage' ).get ('softwareReferences' ) and \
43+ len (block_device .get ('diskImage' ).get ('softwareReferences' )) != 0 :
44+ operative_system = block_device .get ('diskImage' ).get ('softwareReferences' )[0 ].\
45+ get ('softwareDescription' ).get ('longDescription' )
3746 visibility = (image_mod .PUBLIC_TYPE if image ['publicFlag' ] else image_mod .PRIVATE_TYPE )
3847 table .add_row ([
3948 image .get ('id' , formatting .blank ()),
@@ -43,6 +52,9 @@ def cli(env, name, public):
4352 utils .lookup (image , 'imageType' , 'name' )),
4453 visibility ,
4554 image .get ('accountId' , formatting .blank ()),
55+ operative_system ,
56+ utils .clean_time (image .get ('createDate' , formatting .blank ())),
57+ image .get ('note' , formatting .blank ()),
4658 ])
4759
4860 env .fout (table )
0 commit comments