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

Conversation

Projects
None yet
4 participants
@edevenport
Copy link
Contributor

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:

This comment has been minimized.

Copy link
@cachedout

cachedout Mar 27, 2018

Collaborator

duplicate command?

This comment has been minimized.

Copy link
@denza

denza Mar 28, 2018

Contributor

Fixed

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

This comment has been minimized.

Copy link
@cachedout

cachedout Mar 27, 2018

Collaborator

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):
'''

This comment has been minimized.

Copy link
@rallytime

rallytime Mar 27, 2018

Contributor

Can you add docs here, please?

This comment has been minimized.

Copy link
@denza

denza Mar 28, 2018

Contributor

Doc comment added

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

This comment has been minimized.

Copy link
@rallytime

rallytime Mar 27, 2018

Contributor

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 added some commits Mar 28, 2018

@denza

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Apr 2, 2018

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

@rallytime
Copy link
Contributor

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)

This comment has been minimized.

Copy link
@rallytime

rallytime Apr 3, 2018

Contributor

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

This comment has been minimized.

Copy link
@denza

denza Apr 3, 2018

Contributor

@rallytime The print statement removed.

@rallytime rallytime merged commit 92328dc into saltstack:develop Apr 4, 2018

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 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 StackPointCloud: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
You can’t perform that action at this time.