Skip to content

Stop(deallocate) and Start vm actions - #45119

Merged
rallytime merged 11 commits into
saltstack:developfrom
sumeetisp:develop
Jan 3, 2018
Merged

rallytime merged 11 commits into
saltstack:developfrom
sumeetisp:develop

Conversation

@sumeetisp

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Done

@rallytime rallytime left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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.

Comment thread salt/cloud/clouds/azurearm.py Outdated
try:
instance_stop = compconn.virtual_machines.deallocate(group, name)
instance_stop.wait()
resource_group = group

Copy link
Copy Markdown
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.

Comment thread salt/cloud/clouds/azurearm.py Outdated
try:
instance_start = compconn.virtual_machines.start(group, name)
instance_start.wait()
resource_group = group

Copy link
Copy Markdown
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

sumeetisp commented Dec 23, 2017 via email

Copy link
Copy Markdown
Contributor Author

@sumeetisp

Copy link
Copy Markdown
Contributor Author

I have made the suggested changes

@rallytime

Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants