Skip to content

(QENG-7604) Add support for Job IDs to ABS delete #60

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

Merged
merged 2 commits into from
Jan 28, 2020
Merged

(QENG-7604) Add support for Job IDs to ABS delete #60

merged 2 commits into from
Jan 28, 2020

Conversation

highb
Copy link
Contributor

@highb highb commented Jan 17, 2020

This commit adds support for passing in a JobID when deleting with ABS.

@highb
Copy link
Contributor Author

highb commented Jan 17, 2020

Here it is working for me:

➜  vmfloaty git:(qeng-7604_add_jobid_to_delete) ./bin/floaty get --service abs centos-7-x86_64=2
Gemfile.lock          bin/                  lib/                  vmfloaty.yml.example
Requesting VMs with job_id: 1579303343358.  Will retry for up to an hour.
Waiting 1 seconds to check if ABS request has been filled.  Queue Position: 199... (x1)
Waiting 2 seconds to check if ABS request has been filled.  Queue Position: 199... (x2)
Waiting 3 seconds to check if ABS request has been filled.  Queue Position: 199... (x3)
Waiting 4 seconds to check if ABS request has been filled.  Queue Position: 199... (x4)
Waiting 5 seconds to check if ABS request has been filled.  Queue Position: 199... (x5)
- smoky-allergy.delivery.puppetlabs.net (centos-7-x86_64)
- vocalic-jig.delivery.puppetlabs.net (centos-7-x86_64)
➜  vmfloaty git:(qeng-7604_add_jobid_to_delete) ./bin/floaty delete --service abs 1579303343358

Scheduled the following VMs for deletion:
- smoky-allergy.delivery.puppetlabs.net
- vocalic-jig.delivery.puppetlabs.net
➜  vmfloaty git:(qeng-7604_add_jobid_to_delete) ./bin/floaty list --active --service abs

Your VMs on cinext-abs.delivery.puppetlabs.net:

@highb
Copy link
Contributor Author

highb commented Jan 17, 2020

@mikkergimenez Will hopefully do some review on this.

@briancain
Copy link
Contributor

Looks like rubocop failed.... @highb to be honest I wouldn't care at all if you just removed it from this repo 🤷‍♂️ It's useful in certain situations but I don't feel like it's worth it for something like this. Up to you all!

@highb
Copy link
Contributor Author

highb commented Jan 21, 2020

Naw, it's probably good to keep it. Consistent style is important. I'll fix it up. 😆

@highb
Copy link
Contributor Author

highb commented Jan 21, 2020

Alright, rubocop seems happy.

lib/vmfloaty.rb Outdated
@@ -184,10 +184,12 @@ def run # rubocop:disable Metrics/AbcSize
end

command :delete do |c|
c.syntax = 'floaty delete hostname,hostname2 [options]'
c.syntax = 'floaty delete hostname,hostname2 [options]
floaty delete job1,job2 [options] (only supported with ABS)'
Copy link
Contributor

Choose a reason for hiding this comment

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

^^indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Futzed around with it a bit and found a better way of adding to the syntax that can be aligned correctly.

Copy link
Contributor

@jcoconnor jcoconnor left a comment

Choose a reason for hiding this comment

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

Looks good @highb - just one minor typo ?

@jcoconnor
Copy link
Contributor

And have just run it through a few tests and appears to work 👍

This commit adds support for passing in a JobID when deleting with ABS.
@highb
Copy link
Contributor Author

highb commented Jan 27, 2020

@briancain John and Mikker are 👍 on this, if you don't mind approving/merging it. 😄

Copy link
Contributor

@briancain briancain left a comment

Choose a reason for hiding this comment

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

🎉

@briancain briancain merged commit fffc16c into puppetlabs:master Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants