Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image removal for azure and aws #465

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

akhil-jha
Copy link
Contributor

@akhil-jha akhil-jha commented Jun 28, 2023

No description provided.

@akhil-jha akhil-jha changed the title [Draft] Image removal for aws, azure, gcp Image removal for azure Jun 29, 2023
@akhil-jha akhil-jha marked this pull request as draft July 12, 2023 08:18
@akhil-jha akhil-jha force-pushed the add_image_removal branch 2 times, most recently from 5d708eb to 51b32f2 Compare July 26, 2023 14:45
@akhil-jha akhil-jha changed the title Image removal for azure Image removal for azure and aws Jul 26, 2023
@akhil-jha akhil-jha marked this pull request as ready for review July 26, 2023 15:12
wrapanapi/systems/ec2.py Outdated Show resolved Hide resolved
wrapanapi/systems/ec2.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Show resolved Hide resolved
wrapanapi/systems/msazure.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Show resolved Hide resolved
wrapanapi/systems/msazure.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jyejare jyejare left a comment

Choose a reason for hiding this comment

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

ACK pending comments !

wrapanapi/systems/ec2.py Outdated Show resolved Hide resolved
wrapanapi/systems/ec2.py Outdated Show resolved Hide resolved
wrapanapi/systems/ec2.py Outdated Show resolved Hide resolved
wrapanapi/systems/msazure.py Show resolved Hide resolved
@@ -1130,6 +1166,21 @@ def delete_stack_by_date(self, days_old, resource_group=None):
result)
return results

def delete_compute_image_using_name(self, resource_group=None, image_list=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead this should be delete images same as you have in EC2 systems. We cannot say by name becuase we are not passing as parameter name , we are just passing image_list be its all free images list or list of all images !

Copy link
Contributor Author

@akhil-jha akhil-jha Aug 3, 2023

Choose a reason for hiding this comment

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

Changed the name to delete_compute_image_by_resource_group(). Having "resource_group" becomes explicit which I think it fine.

free_images = []
vm_list = self.list_vms()

if not vm_list:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This block is unnecessary and repetitive.

for vm in vm_list:
    free_images.append()
return free_images 

This loop will noop when vm_list is an empty list, which the function is written to return.

@mshriver mshriver merged commit 4db24f1 into RedHatQE:master Aug 7, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants