Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

utils: Don't change the name of the image, breaks the get_ami.py layout #94

Conversation

sayanchowdhury
Copy link
Contributor

Signed-off-by: Sayan Chowdhury [email protected]

@@ -238,7 +238,7 @@ def copy_images_to_regions(self, image_id=None, base_region=None, regions=None):
for region in regions:
log.info('Copy %s to %s started' % (image_id, region))
self.set_region(region)
self.image_name = get_image_name_from_ami_name(image.name, region)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're going to remove this function call then we can remove the import of this function at the top of the file

fedimg/utils.py Outdated
@@ -154,8 +154,7 @@ def get_image_name_from_image(image_url, virt_type='', region='', respin='0',
file_name = get_file_name_image(image_url)
build_name = file_name.replace('.raw.xz', '')

return '-'.join(
[x for x in [build_name, virt_type, region, volume_type, respin] if x])
return build_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are doing this then we need to change it so that the function doesn't require all of those arguments (that are no longer used and update any calls to this function).

fedimg/utils.py Outdated
@@ -154,8 +154,7 @@ def get_image_name_from_image(image_url, virt_type='', region='', respin='0',
file_name = get_file_name_image(image_url)
build_name = file_name.replace('.raw.xz', '')

return '-'.join(
[x for x in [build_name, virt_type, region, volume_type, respin] if x])
return build_name


def get_image_name_from_ami_name(image_name, region):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this function need to be updated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or rather,, looks like it needs to be deleted

@sayanchowdhury sayanchowdhury force-pushed the hotfix/change-image-name-format branch 2 times, most recently from 651bb22 to bc34171 Compare April 13, 2018 21:39
@sinnykumari
Copy link
Contributor

LGTM

@@ -164,3 +164,10 @@ def get_image_name_from_ami_name(image_name, region):

return '-'.join(
[x for x in [name_vt, region, volume_type, respin] if x])


def get_image_name_from_ami_name_for_fedmsg(image_name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand why we need a new function here? Why do we need to name the ami something different than Fedora-Cloud-Base-26-20180329.0.x86_64 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just name the ami Fedora-Cloud-Base-26-20180329.0.x86_64 too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the name similar to how we use to have earlier in AWS. We can change the name to Fedora-Cloud-Base-26-20180329.0.x86_64 but might need to add a field incase a AMI with the same name is already there.

Also, I think it's better to have the volume name included in the image name ie standard & gp2.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah - I honestly don't really think people use the name that much. I think there is value in being able to search the same name across all regions and find all AMIs that were made from the same compose. I guess there are probably better ways to do that too

@sayanchowdhury
Copy link
Contributor Author

I'm cutting out a release. I'm merging this PR. Let's create an issue, if required I'll make the changes to the AMI name in the next release.

@sayanchowdhury sayanchowdhury force-pushed the hotfix/change-image-name-format branch from bc34171 to 3946ed1 Compare April 16, 2018 10:39
@sayanchowdhury sayanchowdhury merged commit 6052870 into fedora-infra:develop Apr 16, 2018
@sayanchowdhury sayanchowdhury deleted the hotfix/change-image-name-format branch April 16, 2018 10:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants