You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2016/04/16 19:39:42 UTC

[01/11] libcloud git commit: Fix linting issue

Repository: libcloud
Updated Branches:
  refs/heads/ex_connection_class_kwargs_regression_fix fd0a22fea -> 5359229c2


Fix linting issue


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/32e9f999
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/32e9f999
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/32e9f999

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: 32e9f99933cc4db89a703603b340095d6e59af3a
Parents: fce3074
Author: anthony-shaw <an...@apache.org>
Authored: Fri Apr 15 15:59:56 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:35:19 2016 +1000

----------------------------------------------------------------------
 libcloud/test/compute/test_dimensiondata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/32e9f999/libcloud/test/compute/test_dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata.py b/libcloud/test/compute/test_dimensiondata.py
index 721b37e..6d66837 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -1737,7 +1737,7 @@ class DimensionDataMockHttp(MockHttp):
         body = self.fixtures.load(
             'server_addDisk.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-    
+
     def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeDisk(self, method, url, body, headers):
         body = self.fixtures.load(
             'server_removeDisk.xml')


[07/11] libcloud git commit: Added port list and address list fields to firewall target class

Posted by to...@apache.org.
Added port list and address list fields to firewall target class


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b8e75126
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b8e75126
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b8e75126

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: b8e7512615716f0e40919d36c33ecb66a02f1f7a
Parents: 308e1a2
Author: anthony-shaw <an...@apache.org>
Authored: Fri Apr 15 16:18:26 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:36:03 2016 +1000

----------------------------------------------------------------------
 libcloud/common/dimensiondata.py                |   5 +-
 libcloud/compute/drivers/dimensiondata.py       |   9 +-
 .../dimensiondata/network_firewallRule.xml      | 244 +------------------
 3 files changed, 15 insertions(+), 243 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8e75126/libcloud/common/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index ff4deb4..8bb4742 100644
--- a/libcloud/common/dimensiondata.py
+++ b/libcloud/common/dimensiondata.py
@@ -806,12 +806,15 @@ class DimensionDataFirewallAddress(object):
     The source or destination model in a firewall rule
     """
     def __init__(self, any_ip, ip_address, ip_prefix_size,
-                 port_begin, port_end):
+                 port_begin, port_end, address_list_id,
+                 port_list_id):
         self.any_ip = any_ip
         self.ip_address = ip_address
         self.ip_prefix_size = ip_prefix_size
         self.port_begin = port_begin
         self.port_end = port_end
+        self.address_list_id = address_list_id
+        self.port_list_id = port_list_id
 
 
 class DimensionDataNatRule(object):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8e75126/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index f74770b..0915777 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -2048,12 +2048,19 @@ class DimensionDataNodeDriver(NodeDriver):
     def _to_firewall_address(self, element):
         ip = element.find(fixxpath('ip', TYPES_URN))
         port = element.find(fixxpath('port', TYPES_URN))
+        port = element.find(fixxpath('port', TYPES_URN))
+        port_list = element.find(fixxpath('portList', TYPES_URN))
+        address_list = element.find(fixxpath('ipAddressList', TYPES_URN))
         return DimensionDataFirewallAddress(
             any_ip=ip.get('address') == 'ANY',
             ip_address=ip.get('address'),
             ip_prefix_size=ip.get('prefixSize'),
             port_begin=port.get('begin') if port is not None else None,
-            port_end=port.get('end') if port is not None else None
+            port_end=port.get('end') if port is not None else None,
+            port_list_id=port_list.get('id', None)
+            if port_list is not None else None,
+            address_list_id=address_list.get('id')
+            if address_list is not None else None
         )
 
     def _to_ip_blocks(self, object):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b8e75126/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml b/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml
index 536b350..50812ca 100644
--- a/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml
+++ b/libcloud/test/compute/fixtures/dimensiondata/network_firewallRule.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<firewallRules xmlns="urn:didata.com:api:cloud:types" pageNumber="1" pageCount="13" totalCount="13" pageSize="50">     
+<firewallRules xmlns="urn:didata.com:api:cloud:types" pageNumber="1" pageCount="14" totalCount="14" pageSize="50">
     <firewallRule id="756cba02-b0bc-48f4-aea5-9445870b6148" datacenterId="NA9" ruleType="DEFAULT_RULE">
         <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
         <name>CCDEFAULT.BlockOutboundMailIPv4</name>
@@ -18,7 +18,7 @@
     </firewallRule>
     <firewallRule id="8ffbe8c1-e545-424b-bfcc-e25c2017537d" datacenterId="NA9" ruleType="DEFAULT_RULE">
         <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>CCDEFAULT.BlockOutboundMailIPv4Secure</name>
+        <name>SpecificSourceIP</name>
         <action>DROP</action>
         <ipVersion>IPV4</ipVersion>
         <protocol>TCP</protocol>
@@ -32,242 +32,4 @@
         <enabled>true</enabled>
         <state>NORMAL</state>
     </firewallRule>
-    <firewallRule id="f93b5139-402b-45c5-af80-aa00e311572e" datacenterId="NA9" ruleType="DEFAULT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>CCDEFAULT.BlockOutboundMailIPv6</name>
-        <action>DROP</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-            <port begin="25"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="83ade810-3983-4009-a250-155c5ab47f54" datacenterId="NA9" ruleType="DEFAULT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>CCDEFAULT.BlockOutboundMailIPv6Secure</name>
-        <action>DROP</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-            <port begin="587"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="cc9e1475-9218-484d-af5f-aba5c9a37c2d" datacenterId="NA9" ruleType="DEFAULT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>CCDEFAULT.DenyExternalInboundIPv6</name>
-        <action>DROP</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>IP</protocol>
-        <source>
-            <ip address="EXTERNAL_IPV6"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="a23db203-99c9-42de-9dce-3a97724b7d4d" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>AllowOctopusTentacleComms6</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="2607:f480:111:1336:6503:544c:74a6:3a28"/>
-            <port begin="10933"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="bc26b74f-9b52-4923-8eda-7fc434759611" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>AllowOctopusComms4</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-            <port begin="10933"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="0bb8cc91-75fd-48a1-b9f8-1d728dabbca1" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>AllowHTTPSinbound</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-            <port begin="443"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="38ff959f-58c5-47b9-af6b-568a23e3c299" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>AllowHTTPSinbound6</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="2607:f480:111:1336:6503:544c:74a6:3a28"/>
-            <port begin="443"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="04159804-e48c-40b5-80f5-48c40d1b7f2f" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>Allow8843Inbound</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-            <port begin="8443"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="4250d8db-db42-4e40-acb0-672ec1a1af1b" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>Allow9443Inbound</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-            <port begin="9443"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="f0119d2f-e891-44ee-af89-76122b4be219" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>Allow9443Inbound6</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="2607:f480:111:1336:6503:544c:74a6:3a28"/>
-            <port begin="8443"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="b976e0e6-4fb2-4f3e-a016-652e02d191b4" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>AllowSTSInbound6</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="ANY"/>
-        </source>
-        <destination>
-            <ip address="2607:f480:111:1336:6503:544c:74a6:3a28"/>
-            <port begin="9443"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-    </firewallRule>
-    <firewallRule id="b976e0e6-4fb2-4f3e-a016-652e02d211b4" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>b30c224c-c95b-4cd9-bb8b-bfdfb5486abf</networkDomainId>
-        <name>SpecificSourceIP</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV6</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-            <ip address="2607:f480:111:1336:6503:544c:74a6:3a28"/>
-        </source>
-        <destination>
-            <ip address="ANY"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-      </firewallRule>
-      <firewallRule id="ce250bd3-0e45-4c13-a6d2-74e0657ef699" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>423c4386-87b4-43c4-9604-88ae237bfc7f</networkDomainId>
-        <name>RULE_WITH_SOURCE_AND_DEST_IP_ONLY</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-          <ip address="10.10.10.15"/>
-        </source>
-        <destination>
-          <ip address="10.10.10.14"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-      </firewallRule>
-      <firewallRule id="ce250bd3-0e45-4c13-a6d2-74e0657ef699" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>423c4386-87b4-43c4-9604-88ae237bfc7f</networkDomainId>
-        <name>RULE_WITH_DEST_IP_NO_PORT</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-          <ip address="10.10.10.15"/>
-        </source>
-        <destination>
-          <ip address="10.10.10.14"/>
-          <port begin="40000" end="40005"/>
-        </destination>
-        <enabled>true</enabled>
-        <state>NORMAL</state>
-      </firewallRule>
-      <firewallRule id="ce250bd3-0e45-4c13-a6d2-74e0657ef700" datacenterId="NA9" ruleType="CLIENT_RULE">
-        <networkDomainId>423c4386-87b4-43c4-9604-88ae237bfc7f</networkDomainId>
-        <name>RULE_WITH_SOURCE_AND_DEST</name>
-        <action>ACCEPT_DECISIVELY</action>
-        <ipVersion>IPV4</ipVersion>
-        <protocol>TCP</protocol>
-        <source>
-          <ip address="10.10.10.0" prefixSize="24"/>
-          <port begin="40000" end="40005"/>
-      </source>
-      <destination>
-        <ip address="10.10.10.0" prefixSize="24"/>
-        <port begin="40000"/>
-      </destination>
-      <enabled>true</enabled>
-      <state>NORMAL</state>
-    </firewallRule>
-</firewallRules>
+</firewallRules>
\ No newline at end of file


[11/11] libcloud git commit: Update changelog.

Posted by to...@apache.org.
Update changelog.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5359229c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5359229c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5359229c

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: 5359229c2125c3a9cd60f1f31ee9f0dabd6c4736
Parents: e87a883
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sat Apr 16 19:35:56 2016 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Apr 16 19:39:00 2016 +0200

----------------------------------------------------------------------
 CHANGES.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5359229c/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 2ede118..770054a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,6 +7,14 @@ Changes with latest version of Apache Libcloud
 General
 ~~~~~~~
 
+- Fix a regression with ``timeout`` argument provided via
+  ``_ex_connection_class_kwargs`` method being overriden with ``None`` inside
+  the ``BaseDriver`` constructor method.
+
+  Reported by Jay Rolette.
+  (GITHUB-755)
+  [Tomaz Muraus, Jay Rolette]
+
 Compute
 ~~~~~~~
 


[05/11] libcloud git commit: Updated tests to check for new scenario

Posted by to...@apache.org.
Updated tests to check for new scenario


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/40f7a68d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/40f7a68d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/40f7a68d

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: 40f7a68ddbbf49d94ade3eb59ca6773f1ff40a0e
Parents: b8e7512
Author: anthony-shaw <an...@apache.org>
Authored: Fri Apr 15 16:27:10 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:36:03 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py   | 52 ++++++++++++++----------
 libcloud/test/compute/test_dimensiondata.py |  7 ++++
 2 files changed, 37 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/40f7a68d/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index 0915777..fed4791 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -1365,32 +1365,40 @@ class DimensionDataNodeDriver(NodeDriver):
         ET.SubElement(create_node, "protocol").text = rule.protocol
         # Setup source port rule
         source = ET.SubElement(create_node, "source")
-        source_ip = ET.SubElement(source, 'ip')
-        if rule.source.any_ip:
-            source_ip.set('address', 'ANY')
+        if rule.source.address_list_id is not None:
+            source_ip = ET.SubElement(source, 'ipAddressListId')
+            source_ip.set('id', rule.source.address_list_id)
         else:
-            source_ip.set('address', rule.source.ip_address)
-            if rule.source.ip_prefix_size is not None:
-                source_ip.set('prefixSize', str(rule.source.ip_prefix_size))
-            if rule.source.port_begin is not None:
-                source_port = ET.SubElement(source, 'port')
-                source_port.set('begin', rule.source.port_begin)
-            if rule.source.port_end is not None:
-                source_port.set('end', rule.source.port_end)
+            source_ip = ET.SubElement(source, 'ip')
+            if rule.source.any_ip:
+                source_ip.set('address', 'ANY')
+            else:
+                source_ip.set('address', rule.source.ip_address)
+                if rule.source.ip_prefix_size is not None:
+                    source_ip.set('prefixSize', str(rule.source.ip_prefix_size))
+                if rule.source.port_begin is not None:
+                    source_port = ET.SubElement(source, 'port')
+                    source_port.set('begin', rule.source.port_begin)
+                if rule.source.port_end is not None:
+                    source_port.set('end', rule.source.port_end)
         # Setup destination port rule
         dest = ET.SubElement(create_node, "destination")
-        dest_ip = ET.SubElement(dest, 'ip')
-        if rule.destination.any_ip:
-            dest_ip.set('address', 'ANY')
+        if rule.destination.address_list_id is not None:
+            dest_ip = ET.SubElement(dest, 'ipAddressListId')
+            dest_ip.set('id', rule.destination.address_list_id)
         else:
-            dest_ip.set('address', rule.destination.ip_address)
-            if rule.destination.ip_prefix_size is not None:
-                dest_ip.set('prefixSize', rule.destination.ip_prefix_size)
-            if rule.destination.port_begin is not None:
-                dest_port = ET.SubElement(dest, 'port')
-                dest_port.set('begin', rule.destination.port_begin)
-            if rule.destination.port_end is not None:
-                dest_port.set('end', rule.destination.port_end)
+            dest_ip = ET.SubElement(dest, 'ip')
+            if rule.destination.any_ip:
+                dest_ip.set('address', 'ANY')
+            else:
+                dest_ip.set('address', rule.destination.ip_address)
+                if rule.destination.ip_prefix_size is not None:
+                    dest_ip.set('prefixSize', rule.destination.ip_prefix_size)
+                if rule.destination.port_begin is not None:
+                    dest_port = ET.SubElement(dest, 'port')
+                    dest_port.set('begin', rule.destination.port_begin)
+                if rule.destination.port_end is not None:
+                    dest_port.set('end', rule.destination.port_end)
         # Set up positioning of rule
         ET.SubElement(create_node, "enabled").text = str(rule.enabled).lower()
         placement = ET.SubElement(create_node, "placement")

http://git-wip-us.apache.org/repos/asf/libcloud/blob/40f7a68d/libcloud/test/compute/test_dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata.py b/libcloud/test/compute/test_dimensiondata.py
index 6d66837..89e1b09 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -704,6 +704,13 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         rule = self.driver.ex_create_firewall_rule(net, specific_source_ip_rule, 'FIRST')
         self.assertEqual(rule.id, 'd0a20f59-77b9-4f28-a63b-e58496b73a6c')
 
+    def test_ex_create_firewall_rule_address_list(self):
+        net = self.driver.ex_get_network_domain('8cdfd607-f429-4df6-9352-162cfc0891be')
+        rule = self.driver.ex_list_firewall_rules(net)[0]
+        rule.source.address_list_id = '12345'
+        rule.destination.address_list_id = '12345'
+        self.driver.ex_create_firewall_rule(net, rule, 'LAST')
+
     def test_ex_create_firewall_rule_ALL_VALUES(self):
         net = self.driver.ex_get_network_domain('8cdfd607-f429-4df6-9352-162cfc0891be')
         rules = self.driver.ex_list_firewall_rules(net)


[10/11] libcloud git commit: Merge branch 'trunk' into ex_connection_class_kwargs_regression_fix

Posted by to...@apache.org.
Merge branch 'trunk' into ex_connection_class_kwargs_regression_fix


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e87a8838
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e87a8838
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e87a8838

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: e87a8838296aa9ecb11adb29dcc1b8f8e765afd0
Parents: fd0a22f 742d23e
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sat Apr 16 19:38:44 2016 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Apr 16 19:38:44 2016 +0200

----------------------------------------------------------------------
 libcloud/common/dimensiondata.py                |   5 +-
 libcloud/compute/drivers/dimensiondata.py       | 106 ++++++--
 libcloud/dns/base.py                            |   2 +-
 libcloud/dns/drivers/durabledns.py              |   2 +-
 libcloud/dns/drivers/pointdns.py                |   2 +-
 libcloud/dns/drivers/worldwidedns.py            |   2 +-
 .../dimensiondata/network_firewallRule.xml      | 244 +------------------
 .../fixtures/dimensiondata/server_addDisk.xml   |   9 +
 .../dimensiondata/server_removeDisk.xml         |   6 +
 libcloud/test/compute/test_dimensiondata.py     |  27 +-
 10 files changed, 133 insertions(+), 272 deletions(-)
----------------------------------------------------------------------



[09/11] libcloud git commit: dns: correct spelling in update_zone() doc string

Posted by to...@apache.org.
dns: correct spelling in update_zone() doc string

"en" -> "an"

Closes #756

Signed-off-by: Tomaz Muraus <to...@tomaz.me>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/742d23ec
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/742d23ec
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/742d23ec

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: 742d23ecd506b73dab1e0cb44b5e7566b71285b6
Parents: f6ffaa5
Author: Ken Dreyer <kt...@ktdreyer.com>
Authored: Sat Apr 16 00:47:38 2016 -0600
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sat Apr 16 11:04:03 2016 +0200

----------------------------------------------------------------------
 libcloud/dns/base.py                 | 2 +-
 libcloud/dns/drivers/durabledns.py   | 2 +-
 libcloud/dns/drivers/pointdns.py     | 2 +-
 libcloud/dns/drivers/worldwidedns.py | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/742d23ec/libcloud/dns/base.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/base.py b/libcloud/dns/base.py
index 6f7cb14..e963e2d 100644
--- a/libcloud/dns/base.py
+++ b/libcloud/dns/base.py
@@ -285,7 +285,7 @@ class DNSDriver(BaseDriver):
 
     def update_zone(self, zone, domain, type='master', ttl=None, extra=None):
         """
-        Update en existing zone.
+        Update an existing zone.
 
         :param zone: Zone to update.
         :type  zone: :class:`Zone`

http://git-wip-us.apache.org/repos/asf/libcloud/blob/742d23ec/libcloud/dns/drivers/durabledns.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/durabledns.py b/libcloud/dns/drivers/durabledns.py
index 5d2fbe8..329db1e 100644
--- a/libcloud/dns/drivers/durabledns.py
+++ b/libcloud/dns/drivers/durabledns.py
@@ -397,7 +397,7 @@ class DurableDNSDriver(DNSDriver):
 
     def update_zone(self, zone, domain, type='master', ttl=None, extra=None):
         """
-        Update en existing zone.
+        Update an existing zone.
 
         :param zone: Zone to update.
         :type  zone: :class:`Zone`

http://git-wip-us.apache.org/repos/asf/libcloud/blob/742d23ec/libcloud/dns/drivers/pointdns.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/pointdns.py b/libcloud/dns/drivers/pointdns.py
index 1523bb9..e9edb36 100644
--- a/libcloud/dns/drivers/pointdns.py
+++ b/libcloud/dns/drivers/pointdns.py
@@ -310,7 +310,7 @@ class PointDNSDriver(DNSDriver):
 
     def update_zone(self, zone, domain, type='master', ttl=None, extra=None):
         """
-        Update en existing zone.
+        Update an existing zone.
 
         :param zone: Zone to update.
         :type  zone: :class:`Zone`

http://git-wip-us.apache.org/repos/asf/libcloud/blob/742d23ec/libcloud/dns/drivers/worldwidedns.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/worldwidedns.py b/libcloud/dns/drivers/worldwidedns.py
index 8b0f90c..f459e52 100644
--- a/libcloud/dns/drivers/worldwidedns.py
+++ b/libcloud/dns/drivers/worldwidedns.py
@@ -167,7 +167,7 @@ class WorldWideDNSDriver(DNSDriver):
     def update_zone(self, zone, domain, type='master', ttl=None, extra=None,
                     ex_raw=False):
         """
-        Update en existing zone.
+        Update an existing zone.
 
         :param zone: Zone to update.
         :type  zone: :class:`Zone`


[03/11] libcloud git commit: Update with new param name for consistency Closes #752

Posted by to...@apache.org.
Update with new param name for consistency
Closes #752


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/308e1a2d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/308e1a2d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/308e1a2d

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: 308e1a2d35dc3e4aac17536ff4dd22dde5ae6bb8
Parents: 32e9f99
Author: anthony-shaw <an...@apache.org>
Authored: Sat Apr 16 15:29:07 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:35:24 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/308e1a2d/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index 1b9695f..f74770b 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -1708,20 +1708,20 @@ class DimensionDataNodeDriver(NodeDriver):
         response_code = findtext(result, 'responseCode', TYPES_URN)
         return response_code in ['IN_PROGRESS', 'OK']
 
-    def ex_remove_storage_from_node(self, node, disk_id):
+    def ex_remove_storage_from_node(self, node, scsi_id):
         """
         Remove storage from a node
 
         :param  node: The server to add storage to
         :type   node: :class:`Node`
 
-        :param  disk_id: The ID of the disk to remove
-        :type   disk_id: ``str``
+        :param  scsi_id: The ID of the disk to remove
+        :type   scsi_id: ``str``
 
         :rtype: ``bool``
         """
         disk = [disk for disk in node.extra['disks']
-                if disk.scsi_id == disk_id][0]
+                if disk.scsi_id == scsi_id][0]
         return self.ex_remove_storage(disk.id)
 
     def ex_remove_storage(self, disk_id):
@@ -1736,13 +1736,13 @@ class DimensionDataNodeDriver(NodeDriver):
 
         :rtype: ``bool``
         """
-        update_node = ET.Element('removeDisk',
+        remove_disk = ET.Element('removeDisk',
                                  {'xmlns': TYPES_URN})
-        update_node.set('id', disk_id)
+        remove_disk.set('id', disk_id)
         result = self.connection.request_with_orgId_api_2(
             'server/removeDisk',
             method='POST',
-            data=ET.tostring(update_node)).object
+            data=ET.tostring(remove_disk)).object
         response_code = findtext(result, 'responseCode', TYPES_URN)
         return response_code in ['IN_PROGRESS', 'OK']
 


[08/11] libcloud git commit: Fixed duplicate set entry Closes #753

Posted by to...@apache.org.
Fixed duplicate set entry
Closes #753


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f6ffaa55
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f6ffaa55
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f6ffaa55

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: f6ffaa55793631bc3ac1de3b8bb95963229c3cdc
Parents: ccbbca5
Author: anthony-shaw <an...@apache.org>
Authored: Sat Apr 16 15:32:56 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:36:09 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f6ffaa55/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index cb345c9..7a969e8 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -2065,7 +2065,6 @@ class DimensionDataNodeDriver(NodeDriver):
     def _to_firewall_address(self, element):
         ip = element.find(fixxpath('ip', TYPES_URN))
         port = element.find(fixxpath('port', TYPES_URN))
-        port = element.find(fixxpath('port', TYPES_URN))
         port_list = element.find(fixxpath('portList', TYPES_URN))
         address_list = element.find(fixxpath('ipAddressList', TYPES_URN))
         return DimensionDataFirewallAddress(


[04/11] libcloud git commit: Added support for port lists

Posted by to...@apache.org.
Added support for port lists


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f3365320
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f3365320
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f3365320

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: f3365320de2dbe65c1b6a5eb8ee1bef133da8edd
Parents: 40f7a68
Author: anthony-shaw <an...@apache.org>
Authored: Fri Apr 15 16:33:28 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:36:03 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py   | 32 +++++++++++++++---------
 libcloud/test/compute/test_dimensiondata.py |  7 ++++++
 2 files changed, 27 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f3365320/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index fed4791..670fefc 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -1367,7 +1367,7 @@ class DimensionDataNodeDriver(NodeDriver):
         source = ET.SubElement(create_node, "source")
         if rule.source.address_list_id is not None:
             source_ip = ET.SubElement(source, 'ipAddressListId')
-            source_ip.set('id', rule.source.address_list_id)
+            source_ip.text = rule.source.address_list_id
         else:
             source_ip = ET.SubElement(source, 'ip')
             if rule.source.any_ip:
@@ -1376,16 +1376,20 @@ class DimensionDataNodeDriver(NodeDriver):
                 source_ip.set('address', rule.source.ip_address)
                 if rule.source.ip_prefix_size is not None:
                     source_ip.set('prefixSize', str(rule.source.ip_prefix_size))
-                if rule.source.port_begin is not None:
-                    source_port = ET.SubElement(source, 'port')
-                    source_port.set('begin', rule.source.port_begin)
-                if rule.source.port_end is not None:
-                    source_port.set('end', rule.source.port_end)
+        if rule.source.port_list_id is not None:
+            source_port = ET.SubElement(source, 'portListId')
+            source_port.text = rule.source.port_list_id
+        else:
+            if rule.source.port_begin is not None:
+                source_port = ET.SubElement(source, 'port')
+                source_port.set('begin', rule.source.port_begin)
+            if rule.source.port_end is not None:
+                source_port.set('end', rule.source.port_end)
         # Setup destination port rule
         dest = ET.SubElement(create_node, "destination")
         if rule.destination.address_list_id is not None:
             dest_ip = ET.SubElement(dest, 'ipAddressListId')
-            dest_ip.set('id', rule.destination.address_list_id)
+            dest_ip.text = rule.destination.address_list_id
         else:
             dest_ip = ET.SubElement(dest, 'ip')
             if rule.destination.any_ip:
@@ -1394,11 +1398,15 @@ class DimensionDataNodeDriver(NodeDriver):
                 dest_ip.set('address', rule.destination.ip_address)
                 if rule.destination.ip_prefix_size is not None:
                     dest_ip.set('prefixSize', rule.destination.ip_prefix_size)
-                if rule.destination.port_begin is not None:
-                    dest_port = ET.SubElement(dest, 'port')
-                    dest_port.set('begin', rule.destination.port_begin)
-                if rule.destination.port_end is not None:
-                    dest_port.set('end', rule.destination.port_end)
+        if rule.destination.port_list_id is not None:
+            dest_port = ET.SubElement(dest, 'portListId')
+            dest_port.text = rule.destination.port_list_id
+        else:
+            if rule.destination.port_begin is not None:
+                dest_port = ET.SubElement(dest, 'port')
+                dest_port.set('begin', rule.destination.port_begin)
+            if rule.destination.port_end is not None:
+                dest_port.set('end', rule.destination.port_end)
         # Set up positioning of rule
         ET.SubElement(create_node, "enabled").text = str(rule.enabled).lower()
         placement = ET.SubElement(create_node, "placement")

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f3365320/libcloud/test/compute/test_dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata.py b/libcloud/test/compute/test_dimensiondata.py
index 89e1b09..1e1fa2a 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -711,6 +711,13 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         rule.destination.address_list_id = '12345'
         self.driver.ex_create_firewall_rule(net, rule, 'LAST')
 
+    def test_ex_create_firewall_rule_port_list(self):
+        net = self.driver.ex_get_network_domain('8cdfd607-f429-4df6-9352-162cfc0891be')
+        rule = self.driver.ex_list_firewall_rules(net)[0]
+        rule.source.port_list_id = '12345'
+        rule.destination.port_list_id = '12345'
+        self.driver.ex_create_firewall_rule(net, rule, 'LAST')
+
     def test_ex_create_firewall_rule_ALL_VALUES(self):
         net = self.driver.ex_get_network_domain('8cdfd607-f429-4df6-9352-162cfc0891be')
         rules = self.driver.ex_list_firewall_rules(net)


[02/11] libcloud git commit: Changed add/remove disk for dimensiondata driver to use new API

Posted by to...@apache.org.
Changed add/remove disk for dimensiondata driver to use new API


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/fce3074f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fce3074f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fce3074f

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: fce3074f29e936b06c09248ea26e30c8805202f6
Parents: 8185276
Author: anthony-shaw <an...@apache.org>
Authored: Fri Apr 15 15:59:56 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:35:19 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py       | 55 ++++++++++++++++----
 .../fixtures/dimensiondata/server_addDisk.xml   |  9 ++++
 .../dimensiondata/server_removeDisk.xml         |  6 +++
 libcloud/test/compute/test_dimensiondata.py     | 13 ++++-
 4 files changed, 71 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/fce3074f/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index 29009db..1b9695f 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -1674,7 +1674,8 @@ class DimensionDataNodeDriver(NodeDriver):
         response_code = findtext(result, 'responseCode', TYPES_URN)
         return response_code in ['IN_PROGRESS', 'OK']
 
-    def ex_add_storage_to_node(self, node, amount, speed='STANDARD'):
+    def ex_add_storage_to_node(self, node, amount,
+                               speed='STANDARD', scsi_id=None):
         """
         Add storage to the node
 
@@ -1687,13 +1688,25 @@ class DimensionDataNodeDriver(NodeDriver):
         :param  speed: The disk speed type
         :type   speed: ``str``
 
+        :param  scsi_id: The target SCSI ID (optional)
+        :type   scsi_id: ``int``
+
         :rtype: ``bool``
         """
-        result = self.connection.request_with_orgId_api_1(
-            'server/%s?addLocalStorage&amount=%s&speed=%s' %
-            (node.id, amount, speed)).object
-        response_code = findtext(result, 'result', GENERAL_NS)
-        return response_code in ['IN_PROGRESS', 'SUCCESS']
+        update_node = ET.Element('addDisk',
+                                 {'xmlns': TYPES_URN})
+        update_node.set('id', node.id)
+        ET.SubElement(update_node, 'sizeGb').text = str(amount)
+        ET.SubElement(update_node, 'speed').text = speed.upper()
+        if scsi_id is not None:
+            ET.SubElement(update_node, 'scsiId').text = str(scsi_id)
+
+        result = self.connection.request_with_orgId_api_2(
+            'server/addDisk',
+            method='POST',
+            data=ET.tostring(update_node)).object
+        response_code = findtext(result, 'responseCode', TYPES_URN)
+        return response_code in ['IN_PROGRESS', 'OK']
 
     def ex_remove_storage_from_node(self, node, disk_id):
         """
@@ -1707,11 +1720,31 @@ class DimensionDataNodeDriver(NodeDriver):
 
         :rtype: ``bool``
         """
-        result = self.connection.request_with_orgId_api_1(
-            'server/%s/disk/%s?delete' %
-            (node.id, disk_id)).object
-        response_code = findtext(result, 'result', GENERAL_NS)
-        return response_code in ['IN_PROGRESS', 'SUCCESS']
+        disk = [disk for disk in node.extra['disks']
+                if disk.scsi_id == disk_id][0]
+        return self.ex_remove_storage(disk.id)
+
+    def ex_remove_storage(self, disk_id):
+        """
+        Remove storage from a node
+
+        :param  node: The server to add storage to
+        :type   node: :class:`Node`
+
+        :param  disk_id: The ID of the disk to remove
+        :type   disk_id: ``str``
+
+        :rtype: ``bool``
+        """
+        update_node = ET.Element('removeDisk',
+                                 {'xmlns': TYPES_URN})
+        update_node.set('id', disk_id)
+        result = self.connection.request_with_orgId_api_2(
+            'server/removeDisk',
+            method='POST',
+            data=ET.tostring(update_node)).object
+        response_code = findtext(result, 'responseCode', TYPES_URN)
+        return response_code in ['IN_PROGRESS', 'OK']
 
     def ex_change_storage_speed(self, node, disk_id, speed):
         """

http://git-wip-us.apache.org/repos/asf/libcloud/blob/fce3074f/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml b/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml
new file mode 100644
index 0000000..4e49bd5
--- /dev/null
+++ b/libcloud/test/compute/fixtures/dimensiondata/server_addDisk.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<response requestId="na9_20160321T074626030-0400_7e9fffe7-190b-46f2-9107 © 2016 Dimension Data Cloud Solutions 260 9d52fe57d0ad" xmlns="urn:didata.com:api:cloud:types">
+    <operation>ADD_DISK</operation>
+    <responseCode>IN_PROGRESS</responseCode>
+    <message>The request to add a 20 GB Standard Speed Disk on Server 'SERVER-1' has been accepted and is being processed.</message>
+    <info name="diskId" value="9e6b496d-5261-4542-91aa-b50c7f569c54" />
+    <info name="scsiId" value="4" />
+    <info name="speed" value="STANDARD" />
+</response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/fce3074f/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml b/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml
new file mode 100644
index 0000000..8b2d17f
--- /dev/null
+++ b/libcloud/test/compute/fixtures/dimensiondata/server_removeDisk.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<response requestId="na9_20160321T074626030-0400_7e9fffe7-190b-46f2-91079d52fe57d0ad" xmlns="urn:didata.com:api:cloud:types">
+    <operation>REMOVE_DISK</operation>
+    <responseCode>IN_PROGRESS</responseCode>
+    <message>Request to Remove disk '540c4d86-4d84-11e4-a91c-0030487e0302' from Server 'Server 1' has been accepted and is being processed.</message>
+</response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/fce3074f/libcloud/test/compute/test_dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata.py b/libcloud/test/compute/test_dimensiondata.py
index 2402cb8..721b37e 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -798,7 +798,7 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
 
     def test_ex_remove_storage_from_node(self):
         node = self.driver.list_nodes()[0]
-        result = self.driver.ex_remove_storage_from_node(node, 1)
+        result = self.driver.ex_remove_storage_from_node(node, 0)
         self.assertTrue(result)
 
     def test_ex_change_storage_speed(self):
@@ -1733,5 +1733,16 @@ class DimensionDataMockHttp(MockHttp):
             'server_cleanServer.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_addDisk(self, method, url, body, headers):
+        body = self.fixtures.load(
+            'server_addDisk.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    
+    def _caas_2_2_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_removeDisk(self, method, url, body, headers):
+        body = self.fixtures.load(
+            'server_removeDisk.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+
 if __name__ == '__main__':
     sys.exit(unittest.main())


[06/11] libcloud git commit: Fix linting issue

Posted by to...@apache.org.
Fix linting issue


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ccbbca5f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ccbbca5f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ccbbca5f

Branch: refs/heads/ex_connection_class_kwargs_regression_fix
Commit: ccbbca5f7ebc13beb2cef78e0abfc53e88b37d03
Parents: f336532
Author: anthony-shaw <an...@apache.org>
Authored: Fri Apr 15 19:13:51 2016 +1000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 16 15:36:03 2016 +1000

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ccbbca5f/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index 670fefc..cb345c9 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -1375,7 +1375,8 @@ class DimensionDataNodeDriver(NodeDriver):
             else:
                 source_ip.set('address', rule.source.ip_address)
                 if rule.source.ip_prefix_size is not None:
-                    source_ip.set('prefixSize', str(rule.source.ip_prefix_size))
+                    source_ip.set('prefixSize',
+                                  str(rule.source.ip_prefix_size))
         if rule.source.port_list_id is not None:
             source_port = ET.SubElement(source, 'portListId')
             source_port.text = rule.source.port_list_id