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

Stop(deallocate) and Start vm actions #45119

Merged
merged 11 commits into from Jan 3, 2018
Merged

Conversation

sumeetisp
Copy link
Contributor

Adding missing functionality for starting and stopping vm

What does this PR do?

This PR adds functionality for stopping(deallocate) and starting azure virtual machines.

What issues does this PR fix or reference?

Previous Behavior

Remove this section if not relevant

New Behavior

Remove this section if not relevant

Tests written?

Yes/No

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Adding missing functionality for starting and stopping vm
@rallytime
Copy link
Contributor

Hi @sumeetisp! Thank you for this addition. Can you fix the lint errors https://jenkins.saltstack.com/job/PR/job/salt-pr-lint-n/17562/violations/file/salt/cloud/clouds/azurearm.py/?

@sumeetisp
Copy link
Contributor Author

Done

Copy link
Contributor

@rallytime rallytime left a comment

Choose a reason for hiding this comment

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

I had a couple of questions and suggestions here. Otherwise this looks good.

def stop(name, resource_group=None, call=None):
'''
Stop a VM

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a .. versionadded:: Fluorine here?

def start(name, resource_group=None, call=None):
'''
Start a VM

Copy link
Contributor

Choose a reason for hiding this comment

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

This also need the same version added tag.

try:
instance_stop = compconn.virtual_machines.deallocate(group, name)
instance_stop.wait()
resource_group = group
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of setting this resource_group variable? It looks like it's not being used anywhere later.

try:
instance_start = compconn.virtual_machines.start(group, name)
instance_start.wait()
resource_group = group
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question about setting the resource group here as above.

@sumeetisp
Copy link
Contributor Author

sumeetisp commented Dec 23, 2017 via email

@sumeetisp
Copy link
Contributor Author

I have made the suggested changes

@rallytime
Copy link
Contributor

@sumeetisp This looks good, but there's a lint failure: https://jenkins.saltstack.com/job/PR/job/salt-pr-lint-n/17815/violations/file/salt/cloud/clouds/azurearm.py/

Once that is fixed up we can get this in. :)

@rallytime
Copy link
Contributor

Go Go Jenkins!

@rallytime rallytime merged commit bb3ad9b into saltstack:develop Jan 3, 2018
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.

None yet

2 participants