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 2016/04/23 05:07:09 UTC
[1/2] libcloud git commit: Added the _ex_connection_class_kwargs way
to handle dynamic parametrs at GoDaddyDNSDriver.
Repository: libcloud
Updated Branches:
refs/heads/trunk 988e3bf32 -> 77afd30dc
Added the _ex_connection_class_kwargs way to handle dynamic parametrs at GoDaddyDNSDriver.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a1ca65d5
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a1ca65d5
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a1ca65d5
Branch: refs/heads/trunk
Commit: a1ca65d5f4c356098bb89724dace6b5f837be7e5
Parents: 988e3bf
Author: Teemu Vesala <Te...@qentinel.com>
Authored: Wed Apr 20 11:44:11 2016 +0000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 23 13:06:43 2016 +1000
----------------------------------------------------------------------
libcloud/dns/drivers/godaddy.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a1ca65d5/libcloud/dns/drivers/godaddy.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/godaddy.py b/libcloud/dns/drivers/godaddy.py
index 1a18e3a..62f2b6d 100644
--- a/libcloud/dns/drivers/godaddy.py
+++ b/libcloud/dns/drivers/godaddy.py
@@ -71,7 +71,7 @@ class GoDaddyDNSConnection(ConnectionKey):
allow_insecure = False
- def __init__(self, key, secret, shopper_id, secure=True, host=None,
+ def __init__(self, key, secret, secure=True, shopper_id=None, host=None,
port=None, url=None, timeout=None,
proxy_url=None, backoff=None, retry_delay=None):
super(GoDaddyDNSConnection, self).__init__(
@@ -130,6 +130,7 @@ class GoDaddyDNSDriver(DNSDriver):
:param secret: Your access key secret
:type secret: ``str``
"""
+ self.shopper_id = shopper_id
super(GoDaddyDNSDriver, self).__init__(key=key, secret=secret,
secure=secure,
host=host, port=port,
@@ -469,6 +470,9 @@ class GoDaddyDNSDriver(DNSDriver):
def _get_id_of_record(self, name, type):
return '%s:%s' % (name, type)
+ def _ex_connection_class_kwargs(self):
+ return {'shopper_id': self.shopper_id}
+
class GoDaddyAvailability(object):
def __init__(self, domain, available, price, currency, period):
[2/2] libcloud git commit: If shopper_id is set to None,
then the X-shopper-id header is not submitted to GoDaddy at all.
Closes #770
Posted by an...@apache.org.
If shopper_id is set to None, then the X-shopper-id header is not submitted to GoDaddy at all. Closes #770
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/77afd30d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/77afd30d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/77afd30d
Branch: refs/heads/trunk
Commit: 77afd30dc0399e7117b84ca0f2b9f8b5a39de86d
Parents: a1ca65d
Author: Teemu Vesala <Te...@qentinel.com>
Authored: Thu Apr 21 19:26:31 2016 +0000
Committer: anthony-shaw <an...@apache.org>
Committed: Sat Apr 23 13:06:44 2016 +1000
----------------------------------------------------------------------
libcloud/dns/drivers/godaddy.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/77afd30d/libcloud/dns/drivers/godaddy.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/godaddy.py b/libcloud/dns/drivers/godaddy.py
index 62f2b6d..62c21d6 100644
--- a/libcloud/dns/drivers/godaddy.py
+++ b/libcloud/dns/drivers/godaddy.py
@@ -87,7 +87,8 @@ class GoDaddyDNSConnection(ConnectionKey):
self.shopper_id = shopper_id
def add_default_headers(self, headers):
- headers['X-Shopper-Id'] = self.shopper_id
+ if self.shopper_id is not None:
+ headers['X-Shopper-Id'] = self.shopper_id
headers['Authorization'] = "sso-key %s:%s" % \
(self.key, self.secret)
return headers