[GitHub] libcloud pull request #819: [WIP] CLC driver

2016-06-17 Thread ack
GitHub user ack opened a pull request:

https://github.com/apache/libcloud/pull/819

[WIP] CLC driver

## CenturyLinkCloud

### Status

- work in progress
- looking for initial feedback

### Checklist (tick everything that applies)

- [ ] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
- [ ] Documentation
- [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ack/libcloud clc

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/819.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #819


commit 38b61eb13fcee91c1a172516da93a9c652b29024
Author: Greg Hill 
Date:   2015-12-15T16:42:47Z

Use hasattr rather than getattr to check for existence

I forgot getattr throws an exception.  This should have
been a hasattr.  Additionally added a check to make sure
it's a dict before treating it as such.
Closes #659

commit 1b3b91cd0e96161b059c15ad2da183f500c3878e
Author: Juan Font Alonso 
Date:   2015-12-10T13:44:43Z

Fixed error when proxy_url is None.

commit eb49f38dfa21887774d24d0cd1079c1958ea8a7e
Author: anthony-shaw 
Date:   2015-12-20T22:05:16Z

Fixed bug in public IP addition command

Closes #661

commit 302b9bba33aeecbc2768c9d796845d31a2a1e9e4
Author: Ming Sheng 
Date:   2015-12-20T15:02:12Z

Fix syntax error for DimensionDataStatus object

Closes #662

commit 22093a6a55a73274be263567effbe1af577e22c7
Author: Eric Johnson 
Date:   2015-12-18T23:57:47Z

[google] Allow for old and new style service account client email address

Closes LIBCLOUD-785

commit d1cf931796f1064f5b1c36d35a80551488fb5d50
Author: Eric Johnson 
Date:   2016-01-15T15:39:46Z

bugfix version 0.20.1

commit 87deb04498ea8bb5068e362810c3d2ab89359b48
Author: Eric Johnson 
Date:   2016-01-15T19:28:44Z

update chnages for 0.20.1

commit 06e5bf54ffea04ba167dd27f4daed542478f1eb0
Author: Albert Choi 
Date:   2016-06-17T20:36:41Z

clc provider

commit abb0ff4c5d29c562ada614f59a8ebc36218b75a1
Author: Albert Choi 
Date:   2016-06-17T20:39:39Z

impl start




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


libcloud git commit: Add some more docs on certifi stuff.

2016-06-17 Thread tomaz
Repository: libcloud
Updated Branches:
  refs/heads/trunk 5e61649d3 -> 99b63ab65


Add some more docs on certifi stuff.


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

Branch: refs/heads/trunk
Commit: 99b63ab655116198485479ce1496a6e0bc91c914
Parents: 5e61649
Author: Tomaz Muraus 
Authored: Fri Jun 17 20:06:11 2016 +0200
Committer: Tomaz Muraus 
Committed: Fri Jun 17 20:06:11 2016 +0200

--
 docs/other/ssl-certificate-validation.rst | 14 ++
 1 file changed, 14 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/99b63ab6/docs/other/ssl-certificate-validation.rst
--
diff --git a/docs/other/ssl-certificate-validation.rst 
b/docs/other/ssl-certificate-validation.rst
index 60f5b20..04b2a92 100644
--- a/docs/other/ssl-certificate-validation.rst
+++ b/docs/other/ssl-certificate-validation.rst
@@ -21,6 +21,20 @@ similar to the one below:
 
 ``No CA Certificates were found in CA_CERTS_PATH.``
 
+The easiest way to resolve this issue is to install `certifi` Python package
+from PyPi using pip. This package provides curated collection of Root
+Certificates based on the Mozilla CA bundle. If this package is installed
+and available, Libcloud will use CA bundle which is bundled by default.
+
+As the list of trusted CA certificates can and does change, you are also
+encouraged to periodically update this package (``pip install --upgrade
+certifi`` or similar).
+
+If for some reason you want to avoid this behavior, you can set
+``LIBCLOUD_SSL_USE_CERTIFI`` environment variable to ``false``. Or even,
+better provide a direct path to the CA bundle you want to use using
+``SSL_CERT_FILE`` environment variable as shown below.
+
 Windows Users
 -
 



[2/2] libcloud git commit: Add .DS_Store to .gitignore.

2016-06-17 Thread tomaz
Add .DS_Store to .gitignore.


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

Branch: refs/heads/trunk
Commit: 5e61649d334a0a3ae851d166e7f998a430437420
Parents: c984dee
Author: Tomaz Muraus 
Authored: Fri Jun 17 19:59:13 2016 +0200
Committer: Tomaz Muraus 
Committed: Fri Jun 17 19:59:13 2016 +0200

--
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5e61649d/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 45fbe88..415882c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ apache_libcloud.egg-info/
 .project
 .pydevproject
 .settings
+.DS_Store



[1/2] libcloud git commit: Remove .DS_Store files.

2016-06-17 Thread tomaz
Repository: libcloud
Updated Branches:
  refs/heads/trunk 01c9bafbd -> 5e61649d3


Remove .DS_Store files.


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

Branch: refs/heads/trunk
Commit: c984deeb3fe316a8e5b66866b7b4da37098fe427
Parents: 01c9baf
Author: Tomaz Muraus 
Authored: Fri Jun 17 19:58:49 2016 +0200
Committer: Tomaz Muraus 
Committed: Fri Jun 17 19:58:49 2016 +0200

--
 .DS_Store  | Bin 8196 -> 0 bytes
 dist/.DS_Store | Bin 8196 -> 0 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c984deeb/.DS_Store
--
diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 789ef67..000
Binary files a/.DS_Store and /dev/null differ

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c984deeb/dist/.DS_Store
--
diff --git a/dist/.DS_Store b/dist/.DS_Store
deleted file mode 100644
index a502daa..000
Binary files a/dist/.DS_Store and /dev/null differ



[GitHub] libcloud pull request #818: Indicate listener ip

2016-06-17 Thread relaxdiego
GitHub user relaxdiego opened a pull request:

https://github.com/apache/libcloud/pull/818

Indicate listener ip

### Description

This is a replacement of PR #815 

The documentation for the Dimension Data Cloud REST API v2.2-20160222 
states that a load balancer can be statically assigned a listener IP on 
creation. This change fixes the dimension data driver to conform to the docs.

Note that one of the commits (sha f06464a) is part of PR #817 

### Status

Replace this: describe the PR status. Examples:

- done, ready for review

### Checklist (tick everything that applies)

- [x] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
- [x] Documentation
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/relaxdiego/libcloud indicate_listener_ip

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/818.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #818


commit f06464ac26f7d6ec0fd380e58d5d80229b0d41f7
Author: Mark S. Maglana 
Date:   2016-06-17T16:23:59Z

Allow setting of load balancer port to None

The documentation for the Dimension Data Cloud REST API v2.2-20160222
states that a load balancer port can be an integer in the range of
1-65535 and, if not supplied, will be taken to mean 'Any Port'. This
change fixes the libcloud driver to conform to the docs.

commit aa1a4664fb5dcd9f566904cdf7dac0b901644d4b
Author: Mark S. Maglana 
Date:   2016-06-16T08:21:50Z

Allow setting of load balancer listener IP

The documentation for the Dimension Data Cloud REST API v2.2-20160222
states that a load balancer can be statically assigned a listener IP
on creation. This change fixes the dimension data driver to conform
to the docs.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] libcloud pull request #817: Allow setting of load balancer port to None

2016-06-17 Thread relaxdiego
GitHub user relaxdiego opened a pull request:

https://github.com/apache/libcloud/pull/817

Allow setting of load balancer port to None

### Description

This is a replacement to PR #814 

The documentation for the Dimension Data Cloud REST API v2.2-20160222 
states that a load balancer port can be an integer in the range of 1-65535 and, 
if not supplied, will be taken to mean 'Any Port'. This change fixes the 
Dimension Data driver to conform to the docs.

### Status

- done, ready for review

### Checklist (tick everything that applies)

- [x] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
- [x] Documentation
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [ ] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/relaxdiego/libcloud fix_dimensiondata_lb_port

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/817.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #817


commit f06464ac26f7d6ec0fd380e58d5d80229b0d41f7
Author: Mark S. Maglana 
Date:   2016-06-17T16:23:59Z

Allow setting of load balancer port to None

The documentation for the Dimension Data Cloud REST API v2.2-20160222
states that a load balancer port can be an integer in the range of
1-65535 and, if not supplied, will be taken to mean 'Any Port'. This
change fixes the libcloud driver to conform to the docs.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[libcloud] Git Push Summary

2016-06-17 Thread anthonyshaw
Repository: libcloud
Updated Tags:  refs/tags/v1.0.0-tentative 4cb76b601 -> d7963b6fe


[GitHub] libcloud pull request #812: Add certifi CA bundle path to Libcloud CA bundle...

2016-06-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/812


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[3/4] libcloud git commit: Drop the if since we want this path to have precedence over others. Closes #812

2016-06-17 Thread anthonyshaw
Drop the if since we want this path to have precedence over others.
Closes #812


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

Branch: refs/heads/trunk
Commit: c1194cba9fcb2d2d148f2a68fa46d74248e1e5b7
Parents: f777da6
Author: Tomaz Muraus 
Authored: Tue Jun 14 19:11:19 2016 +0200
Committer: Anthony Shaw 
Committed: Fri Jun 17 16:36:56 2016 +1000

--
 libcloud/security.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c1194cba/libcloud/security.py
--
diff --git a/libcloud/security.py b/libcloud/security.py
index 8338a44..57465d8 100644
--- a/libcloud/security.py
+++ b/libcloud/security.py
@@ -76,9 +76,7 @@ else:
 
 if has_certifi and USE_CERTIFI:
 certifi_ca_bundle_path = certifi.where()
-
-if certifi_ca_bundle_path not in CA_CERTS_PATH:
-CA_CERTS_PATH.insert(0, certifi_ca_bundle_path)
+CA_CERTS_PATH.insert(0, certifi_ca_bundle_path)
 
 # Allow user to explicitly specify which CA bundle to use, using an environment
 # variable



[4/4] libcloud git commit: make reference to certifi as per #812

2016-06-17 Thread anthonyshaw
make reference to certifi as per #812


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

Branch: refs/heads/trunk
Commit: 01c9bafbdaae23e07a24dadc701cd8bfb95d7708
Parents: c1194cb
Author: Anthony Shaw 
Authored: Fri Jun 17 16:38:44 2016 +1000
Committer: Anthony Shaw 
Committed: Fri Jun 17 16:38:44 2016 +1000

--
 .DS_Store | Bin 0 -> 8196 bytes
 dist/.DS_Store| Bin 0 -> 8196 bytes
 docs/other/ssl-certificate-validation.rst |   1 +
 3 files changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/01c9bafb/.DS_Store
--
diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 000..789ef67
Binary files /dev/null and b/.DS_Store differ

http://git-wip-us.apache.org/repos/asf/libcloud/blob/01c9bafb/dist/.DS_Store
--
diff --git a/dist/.DS_Store b/dist/.DS_Store
new file mode 100644
index 000..a502daa
Binary files /dev/null and b/dist/.DS_Store differ

http://git-wip-us.apache.org/repos/asf/libcloud/blob/01c9bafb/docs/other/ssl-certificate-validation.rst
--
diff --git a/docs/other/ssl-certificate-validation.rst 
b/docs/other/ssl-certificate-validation.rst
index 8df8522..60f5b20 100644
--- a/docs/other/ssl-certificate-validation.rst
+++ b/docs/other/ssl-certificate-validation.rst
@@ -9,6 +9,7 @@ certificate files.
 ``CA_CERTS_PATH`` contains common paths to CA bundle installations on the
 following platforms:
 
+* ``certifi`` package on PyPi
 * ``openssl`` package on CentOS / Fedora
 * ``ca-certificates`` package on Debian / Ubuntu / Arch / Gentoo
 * ``ca_root_nss`` port on FreeBSD



[2/4] libcloud git commit: If certifi library is available and installed on the system, insert certifi CA bundle path in the front of the Libcloud CA bundle search list.

2016-06-17 Thread anthonyshaw
If certifi library is available and installed on the system, insert certifi CA 
bundle path in the front of the Libcloud CA bundle search list.

This behavior can be disabled by setting LIBCLOUD_SSL_USE_CERTIFI environment
variable to false.


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

Branch: refs/heads/trunk
Commit: ec78da25b24c1b1e01ad7b830c9e6be2088acb5c
Parents: a4a58f9
Author: Tomaz Muraus 
Authored: Tue Jun 14 18:18:48 2016 +0200
Committer: Anthony Shaw 
Committed: Fri Jun 17 16:36:42 2016 +1000

--
 libcloud/security.py | 19 +++
 1 file changed, 19 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec78da25/libcloud/security.py
--
diff --git a/libcloud/security.py b/libcloud/security.py
index 782d138..8338a44 100644
--- a/libcloud/security.py
+++ b/libcloud/security.py
@@ -36,6 +36,10 @@ VERIFY_SSL_CERT = True
 
 SSL_VERSION = ssl.PROTOCOL_TLSv1
 
+# True to use certifi CA bundle path when certifi library is available
+USE_CERTIFI = os.environ.get('LIBCLOUD_SSL_USE_CERTIFI', True)
+USE_CERTIFI = str(USE_CERTIFI).lower() in ['true', '1']
+
 # File containing one or more PEM-encoded CA certificates
 # concatenated together.
 CA_CERTS_PATH = [
@@ -61,6 +65,21 @@ CA_CERTS_PATH = [
 '/etc/ssl/certs/YaST-CA.pem',
 ]
 
+# Insert certifi CA bundle path to the front of Libcloud CA bundle search
+# path if certifi is available
+try:
+import certifi
+except ImportError:
+has_certifi = False
+else:
+has_certifi = True
+
+if has_certifi and USE_CERTIFI:
+certifi_ca_bundle_path = certifi.where()
+
+if certifi_ca_bundle_path not in CA_CERTS_PATH:
+CA_CERTS_PATH.insert(0, certifi_ca_bundle_path)
+
 # Allow user to explicitly specify which CA bundle to use, using an environment
 # variable
 environment_cert_file = os.getenv('SSL_CERT_FILE', None)



[1/4] libcloud git commit: Add tests for certifi CA bundle path stuff.

2016-06-17 Thread anthonyshaw
Repository: libcloud
Updated Branches:
  refs/heads/trunk a4a58f9c5 -> 01c9bafbd


Add tests for certifi CA bundle path stuff.


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

Branch: refs/heads/trunk
Commit: f777da60d520c06373f6182e5ef44aa10e9b5837
Parents: ec78da2
Author: Tomaz Muraus 
Authored: Tue Jun 14 19:06:27 2016 +0200
Committer: Anthony Shaw 
Committed: Fri Jun 17 16:36:42 2016 +1000

--
 libcloud/test/test_httplib_ssl.py | 47 ++
 1 file changed, 47 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f777da60/libcloud/test/test_httplib_ssl.py
--
diff --git a/libcloud/test/test_httplib_ssl.py 
b/libcloud/test/test_httplib_ssl.py
index 996498f..0fac77d 100644
--- a/libcloud/test/test_httplib_ssl.py
+++ b/libcloud/test/test_httplib_ssl.py
@@ -152,6 +152,53 @@ class TestHttpLibSSLTests(unittest.TestCase):
 self.assertEqual(e.errno, 105)
 self.assertTrue('Some random error' in str(e))
 
+def test_certifi_ca_bundle_in_search_path(self):
+mock_certifi_ca_bundle_path = '/certifi/bundle/path'
+
+# Certifi not available
+import libcloud.security
+reload(libcloud.security)
+
+original_length = len(libcloud.security.CA_CERTS_PATH)
+
+self.assertTrue(mock_certifi_ca_bundle_path not in
+libcloud.security.CA_CERTS_PATH)
+
+# Certifi is available
+mock_certifi = mock.Mock()
+mock_certifi.where.return_value = mock_certifi_ca_bundle_path
+sys.modules['certifi'] = mock_certifi
+
+# Certifi CA bundle path should be injected at the begining of search 
list
+import libcloud.security
+reload(libcloud.security)
+
+self.assertEqual(libcloud.security.CA_CERTS_PATH[0],
+ mock_certifi_ca_bundle_path)
+self.assertEqual(len(libcloud.security.CA_CERTS_PATH),
+ (original_length + 1))
+
+# Certifi is available, but USE_CERTIFI is set to False
+os.environ['LIBCLOUD_SSL_USE_CERTIFI'] = 'false'
+
+import libcloud.security
+reload(libcloud.security)
+
+self.assertTrue(mock_certifi_ca_bundle_path not in
+libcloud.security.CA_CERTS_PATH)
+self.assertEqual(len(libcloud.security.CA_CERTS_PATH), original_length)
+
+# And enabled
+os.environ['LIBCLOUD_SSL_USE_CERTIFI'] = 'true'
+
+import libcloud.security
+reload(libcloud.security)
+
+self.assertEqual(libcloud.security.CA_CERTS_PATH[0],
+ mock_certifi_ca_bundle_path)
+self.assertEqual(len(libcloud.security.CA_CERTS_PATH),
+ (original_length + 1))
+
 
 if __name__ == '__main__':
 sys.exit(unittest.main())