@@ -143,7 +143,7 @@ def _prep_server_detail(compute_client, image_client, server, refresh=True):
143143 if image_info :
144144 image_id = image_info .get ('id' , '' )
145145 try :
146- image = utils . find_resource ( image_client .images , image_id )
146+ image = image_client .get_image ( image_id )
147147 info ['image' ] = "%s (%s)" % (image .name , image_id )
148148 except Exception :
149149 info ['image' ] = image_id
@@ -735,10 +735,8 @@ def _show_progress(progress):
735735 # Lookup parsed_args.image
736736 image = None
737737 if parsed_args .image :
738- image = utils .find_resource (
739- image_client .images ,
740- parsed_args .image ,
741- )
738+ image = image_client .find_image (
739+ parsed_args .image , ignore_missing = False )
742740
743741 if not image and parsed_args .image_property :
744742 def emit_duplicated_warning (img , image_property ):
@@ -749,7 +747,7 @@ def emit_duplicated_warning(img, image_property):
749747 'chosen_one' : img_uuid_list [0 ]})
750748
751749 def _match_image (image_api , wanted_properties ):
752- image_list = image_api .image_list ()
750+ image_list = image_api .images ()
753751 images_matched = []
754752 for img in image_list :
755753 img_dict = {}
@@ -768,7 +766,7 @@ def _match_image(image_api, wanted_properties):
768766 return []
769767 return images_matched
770768
771- images = _match_image (image_client . api , parsed_args .image_property )
769+ images = _match_image (image_client , parsed_args .image_property )
772770 if len (images ) > 1 :
773771 emit_duplicated_warning (images ,
774772 parsed_args .image_property )
@@ -890,8 +888,8 @@ def _match_image(image_api, wanted_properties):
890888 # one specified by --image, then the compute service will
891889 # create a volume from the image and attach it to the
892890 # server as a non-root volume.
893- image_id = utils . find_resource (
894- image_client . images , dev_map [ 0 ] ).id
891+ image_id = image_client . find_image ( dev_map [ 0 ],
892+ ignore_missing = False ).id
895893 mapping ['uuid' ] = image_id
896894 # 3. append size and delete_on_termination if exist
897895 if len (dev_map ) > 2 and dev_map [2 ]:
@@ -1324,8 +1322,8 @@ def take_action(self, parsed_args):
13241322 # image name is given, map it to ID.
13251323 image_id = None
13261324 if parsed_args .image :
1327- image_id = utils . find_resource ( image_client . images ,
1328- parsed_args . image ).id
1325+ image_id = image_client . find_image ( parsed_args . image ,
1326+ ignore_missing = False ).id
13291327
13301328 search_opts = {
13311329 'reservation_id' : parsed_args .reservation_id ,
@@ -1476,12 +1474,12 @@ def take_action(self, parsed_args):
14761474 (s .image .get ('id' ) for s in data
14771475 if s .image ))):
14781476 try :
1479- images [i_id ] = image_client .images . get (i_id )
1477+ images [i_id ] = image_client .get_image (i_id )
14801478 except Exception :
14811479 pass
14821480 else :
14831481 try :
1484- images_list = image_client .images . list ()
1482+ images_list = image_client .images ()
14851483 for i in images_list :
14861484 images [i .id ] = i
14871485 except Exception :
@@ -1925,7 +1923,7 @@ def _show_progress(progress):
19251923 # If parsed_args.image is not set, default to the currently used one.
19261924 image_id = parsed_args .image or server .to_dict ().get (
19271925 'image' , {}).get ('id' )
1928- image = utils . find_resource ( image_client .images , image_id )
1926+ image = image_client .get_image ( image_id )
19291927
19301928 kwargs = {}
19311929 if parsed_args .property :
@@ -2195,10 +2193,7 @@ def take_action(self, parsed_args):
21952193
21962194 image = None
21972195 if parsed_args .image :
2198- image = utils .find_resource (
2199- image_client .images ,
2200- parsed_args .image ,
2201- )
2196+ image = image_client .find_image (parsed_args .image )
22022197
22032198 utils .find_resource (
22042199 compute_client .servers ,
0 commit comments