You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2015/11/18 23:57:32 UTC
[1/2] libcloud git commit: Allow location of the data center to be
supplied Closes #635 Signed-off-by: Anthony Shaw
Repository: libcloud
Updated Branches:
refs/heads/trunk f13b236ef -> 6f21c38dc
Allow location of the data center to be supplied
Closes #635
Signed-off-by: Anthony Shaw <an...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/3415ef20
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/3415ef20
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/3415ef20
Branch: refs/heads/trunk
Commit: 3415ef20ed259a5ef7ae5adbda4c2abe34f82522
Parents: f13b236
Author: Joel Reymont <jo...@gmail.com>
Authored: Wed Nov 18 22:14:34 2015 +0100
Committer: Anthony Shaw <an...@gmail.com>
Committed: Thu Nov 19 06:55:06 2015 +0800
----------------------------------------------------------------------
libcloud/compute/drivers/profitbricks.py | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/3415ef20/libcloud/compute/drivers/profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/profitbricks.py b/libcloud/compute/drivers/profitbricks.py
index fa33f0c..53fba79 100644
--- a/libcloud/compute/drivers/profitbricks.py
+++ b/libcloud/compute/drivers/profitbricks.py
@@ -375,10 +375,10 @@ class ProfitBricksNodeDriver(NodeDriver):
return True
- def create_node(self, name, image, size=None, volume=None,
- ex_datacenter=None, ex_internet_access=True,
- ex_availability_zone=None, ex_ram=None,
- ex_cores=None, ex_disk=None, **kwargs):
+ def create_node(self, name, image, size=None, location=None,
+ volume=None, ex_datacenter=None, ex_internet_access=True,
+ ex_availability_zone=None, ex_ram=None, ex_cores=None,
+ ex_disk=None, **kwargs):
"""
Creates a node.
@@ -389,6 +389,10 @@ class ProfitBricksNodeDriver(NodeDriver):
:param volume: If the volume already exists then pass this in.
:type volume: :class:`StorageVolume`
+ :param location: The location of the new data center
+ if one is not supplied.
+ :type location: : :class:`NodeLocation`
+
:param ex_datacenter: If you've already created the DC then pass
it in.
:type ex_datacenter: :class:`Datacenter`
@@ -417,7 +421,10 @@ class ProfitBricksNodeDriver(NodeDriver):
'''
'Creating a Datacenter for the node since one was not provided.'
- new_datacenter = self._create_new_datacenter_for_node(name=name)
+ new_datacenter = self._create_new_datacenter_for_node(
+ name=name,
+ location=location
+ )
datacenter_id = new_datacenter.id
'Waiting for the Datacenter create operation to finish.'
@@ -1431,13 +1438,17 @@ class ProfitBricksNodeDriver(NodeDriver):
return datacenter
- def _create_new_datacenter_for_node(self, name):
+ def _create_new_datacenter_for_node(self, name, location):
"""
Creates a Datacenter for a node.
"""
dc_name = name + '-DC'
- return self.ex_create_datacenter(name=dc_name, location='us/las')
+ if not location:
+ loc = 'us/las'
+ else:
+ loc = location.id
+ return self.ex_create_datacenter(name=dc_name, location=loc)
def _wait_for_storage_volume_state(self, volume, state=NodeState.RUNNING,
timeout=300, interval=5):
[2/2] libcloud git commit: Updated Changes.rst
Posted by an...@apache.org.
Updated Changes.rst
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6f21c38d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6f21c38d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6f21c38d
Branch: refs/heads/trunk
Commit: 6f21c38dc9dae4bb21a890526c3320af586a7573
Parents: 3415ef2
Author: Anthony Shaw <an...@gmail.com>
Authored: Thu Nov 19 06:57:30 2015 +0800
Committer: Anthony Shaw <an...@gmail.com>
Committed: Thu Nov 19 06:57:30 2015 +0800
----------------------------------------------------------------------
CHANGES.rst | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/6f21c38d/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 9e56411..a655432 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -62,6 +62,10 @@ Compute
[GITHUB-634]
[Benjamin Zaitlen]
+- Allow location of the datacenter to be supplied in ProfitBricks driver
+ [LIBCLOUD-771, GITHUB-635]
+ [Joel Reymont]
+
Storage
~~~~~~~