Skip to content

Commit 2bf123f

Browse files
Mohammed Al-Dokimistephenfin
authored andcommitted
Removed the emit_duplicated_warning() funtion.
Since this function is called once, I moved its implementaion to where its called. Story: 2010344 Change-Id: Iaf06def1a06ffbb605ee42569e6f87b409a72772
1 parent c2d96c5 commit 2bf123f

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

openstackclient/compute/v2/server.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,17 +1520,6 @@ def _show_progress(progress):
15201520

15211521
if not image and parsed_args.image_properties:
15221522

1523-
def emit_duplicated_warning(img):
1524-
img_uuid_list = [str(image.id) for image in img]
1525-
LOG.warning(
1526-
'Multiple matching images: %(img_uuid_list)s\n'
1527-
'Using image: %(chosen_one)s',
1528-
{
1529-
'img_uuid_list': img_uuid_list,
1530-
'chosen_one': img_uuid_list[0],
1531-
},
1532-
)
1533-
15341523
def _match_image(image_api, wanted_properties):
15351524
image_list = image_api.images()
15361525
images_matched = []
@@ -1568,7 +1557,15 @@ def _match_image(image_api, wanted_properties):
15681557

15691558
images = _match_image(image_client, parsed_args.image_properties)
15701559
if len(images) > 1:
1571-
emit_duplicated_warning(images, parsed_args.image_properties)
1560+
img_uuid_list = [str(image.id) for image in images]
1561+
LOG.warning(
1562+
'Multiple matching images: %(img_uuid_list)s\n'
1563+
'Using image: %(chosen_one)s',
1564+
{
1565+
'img_uuid_list': img_uuid_list,
1566+
'chosen_one': img_uuid_list[0],
1567+
},
1568+
)
15721569
if images:
15731570
image = images[0]
15741571
else:

0 commit comments

Comments
 (0)