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

Reserve public IP block #46724

Merged
merged 9 commits into from Apr 4, 2018
Merged

Conversation

@edevenport
Copy link
Contributor

@edevenport edevenport commented Mar 27, 2018

What does this PR do?

Provides a CLI function allowing IP blocks to be reserved. The public IPs can then be used in the cloud profile.

Previous Behavior

IP blocks had to be reserved via the provider UI or other tools.

New Behavior

IP blocks can be reserved from the salt-cloud CLI.

Tests written?

No

Commits signed with GPG?

No

@@ -151,6 +151,14 @@ command:
# salt-cloud --list-sizes my-profitbricks-config
.. versionadded:: Fluorine
One or more public IP address can be reserved with the following command:
command:
Copy link
Contributor

@cachedout cachedout Mar 27, 2018

duplicate command?

Copy link
Contributor

@denza denza Mar 28, 2018

Fixed

@@ -120,7 +120,7 @@
import profitbricks
from profitbricks.client import (
ProfitBricksService, Server,
NIC, Volume, FirewallRule,
NIC, Volume, FirewallRule, IPBlock,
Copy link
Contributor

@cachedout cachedout Mar 27, 2018

Is IPBlock a new addition to this upstream library or has it been present for a while? We want to make sure we preserve backward compatibility.

@@ -624,6 +626,40 @@ def list_nodes_full(conn=None, call=None):
return ret


def reserve_ipblock(call=None, kwargs=None):
'''
Copy link
Contributor

@rallytime rallytime Mar 27, 2018

Can you add docs here, please?

Copy link
Contributor

@denza denza Mar 28, 2018

Doc comment added

@@ -120,7 +120,7 @@
import profitbricks
from profitbricks.client import (
ProfitBricksService, Server,
NIC, Volume, FirewallRule,
NIC, Volume, FirewallRule, IPBlock,
Copy link
Contributor

@rallytime rallytime Mar 27, 2018

Is IPBlock new to the latest release of profitbricks? The minimum version required is 3.1.0 according to the docs in this file. This import needs to be handled more elegantly if someone is using profitbricks with an older version.

@denza
Copy link
Contributor

@denza denza commented Mar 28, 2018

@rallytime @cachedout
IP Block feature is present in the Profitbricks SDK/API from the first version. This is just the first time we are making this feature available in the salt cli. This new method is just one part of a larger project where we are trying to improvement usability of the network management.

@denza
Copy link
Contributor

@denza denza commented Apr 2, 2018

@rallytime @cachedout Could you please let us know if you require any further changes.

Copy link
Contributor

@rallytime rallytime left a comment

Hi @edevenport and @denza I just have one small request on this, otherwise this LGTM.

size = kwargs.get('size')

block = conn.reserve_ipblock(IPBlock(size=size, location=location))
pprint.pprint(block)
Copy link
Contributor

@rallytime rallytime Apr 3, 2018

Can you remove this print statement? You can use logging if necessary, but we don't like to print directly this way.

Copy link
Contributor

@denza denza Apr 3, 2018

@rallytime The print statement removed.

@rallytime rallytime merged commit 92328dc into saltstack:develop Apr 4, 2018
5 of 10 checks passed
5 of 10 checks passed
default Build finished.
Details
jenkins/PR/salt-pr-linode-cent7-py3 Pull Requests » Salt PR - Linode CentOS 7 - PY3 #3728 — FAILURE
Details
jenkins/PR/salt-pr-linode-ubuntu14-n Pull Requests » Salt PR - Linode Ubuntu14.04 #21466 — FAILURE
Details
jenkins/PR/salt-pr-linode-ubuntu16-py3 Pull Requests » Salt PR - Linode Ubuntu16.04 - PY3 #8534 — FAILURE
Details
jenkins/PR/salt-pr-rs-cent7-n Pull Requests » Salt PR - RS CentOS 7 #17772 — FAILURE
Details
@wip[bot]
WIP ready for review
Details
codeclimate All good!
Details
jenkins/PR/salt-pr-clone Pull Requests » Salt PR - Clone #23886 — SUCCESS
Details
jenkins/PR/salt-pr-docs-n Pull Requests » Salt PR - Docs #16058 — SUCCESS
Details
jenkins/PR/salt-pr-lint-n Pull Requests » Salt PR - Code Lint #20677 — SUCCESS
Details
@edevenport edevenport deleted the reserve_public_ip branch Apr 10, 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants