@@ -29,11 +29,18 @@ 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' ])
3333
3434 images = [image for image in images if not image ['parentId' ]]
3535 for image in images :
36-
36+ operative_system = '-'
37+ if image .get ('children' ) and len (image .get ('children' )) != 0 :
38+ if image .get ('children' )[0 ].get ('blockDevices' ) and len (image .get ('children' )[0 ].get ('blockDevices' )) != 0 :
39+ for block_device in image .get ('children' )[0 ].get ('blockDevices' ):
40+ if block_device .get ('diskImage' ).get ('softwareReferences' ) and \
41+ len (block_device .get ('diskImage' ).get ('softwareReferences' )) != 0 :
42+ operative_system = block_device .get ('diskImage' ).get ('softwareReferences' )[0 ].\
43+ get ('softwareDescription' ).get ('longDescription' )
3744 visibility = (image_mod .PUBLIC_TYPE if image ['publicFlag' ] else image_mod .PRIVATE_TYPE )
3845 table .add_row ([
3946 image .get ('id' , formatting .blank ()),
@@ -43,6 +50,9 @@ def cli(env, name, public):
4350 utils .lookup (image , 'imageType' , 'name' )),
4451 visibility ,
4552 image .get ('accountId' , formatting .blank ()),
53+ operative_system ,
54+ image .get ('createDate' , formatting .blank ()),
55+ image .get ('note' , formatting .blank ()),
4656 ])
4757
4858 env .fout (table )
0 commit comments