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 2017/08/20 23:32:08 UTC
[2/4] libcloud git commit: add most basic fix
add most basic fix
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/8041ca25
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/8041ca25
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/8041ca25
Branch: refs/heads/trunk
Commit: 8041ca2580a4c632d3e28c092a7ced9905a0ac2c
Parents: b3b5086
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Aug 21 09:06:17 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Aug 21 09:06:17 2017 +1000
----------------------------------------------------------------------
libcloud/dns/drivers/route53.py | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/8041ca25/libcloud/dns/drivers/route53.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/route53.py b/libcloud/dns/drivers/route53.py
index c378f00..6632cd3 100644
--- a/libcloud/dns/drivers/route53.py
+++ b/libcloud/dns/drivers/route53.py
@@ -188,6 +188,8 @@ class Route53DNSDriver(DNSDriver):
return response.status in [httplib.OK]
def create_record(self, name, zone, type, data, extra=None):
+ if type in (RecordType.TXT, RecordType.SPF):
+ data = self._quote_data(data)
extra = extra or {}
batch = [('CREATE', name, type, data, extra)]
self._post_changeset(zone, batch)
@@ -555,3 +557,8 @@ class Route53DNSDriver(DNSDriver):
kwargs = super(Route53DNSDriver, self)._ex_connection_class_kwargs()
kwargs['token'] = self.token
return kwargs
+
+ def _quote_data(self, data):
+ if data[0] == '"' and data[-1] == '"':
+ return data
+ return '"{0}"'.format(data)