libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [3/6] git commit: Use shorther notation.
Date Fri, 21 Mar 2014 14:35:47 GMT
Use shorther notation.


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

Branch: refs/heads/trunk
Commit: 5e5eaeab4c4d24bae199f5bc061fcc3baab336cd
Parents: 692c528
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Fri Mar 21 14:46:44 2014 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Fri Mar 21 14:46:44 2014 +0100

----------------------------------------------------------------------
 libcloud/dns/drivers/route53.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5e5eaeab/libcloud/dns/drivers/route53.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/route53.py b/libcloud/dns/drivers/route53.py
index 5cc8664..86e3754 100644
--- a/libcloud/dns/drivers/route53.py
+++ b/libcloud/dns/drivers/route53.py
@@ -185,6 +185,7 @@ class Route53DNSDriver(DNSDriver):
         return response.status in [httplib.OK]
 
     def create_record(self, name, zone, type, data, extra=None):
+        extra = extra or {}
         batch = [('CREATE', name, type, data, extra)]
         self._post_changeset(zone, batch)
         id = ':'.join((self.RECORD_TYPE_MAP[type], name))
@@ -256,11 +257,9 @@ class Route53DNSDriver(DNSDriver):
 
     def update_record(self, record, name=None, type=None, data=None,
                       extra=None):
-        if not name:
-            name = record.name
-
-        if not type:
-            type = record.type
+        name = name or record.name
+        type = type or record.type
+        extra = extra or record.extra
 
         if not extra:
             extra = record.extra


Mime
View raw message