libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1362392 - in /libcloud/trunk: CHANGES libcloud/dns/drivers/rackspace.py libcloud/test/dns/test_rackspace.py
Date Tue, 17 Jul 2012 07:43:25 GMT
Author: tomaz
Date: Tue Jul 17 07:43:24 2012
New Revision: 1362392

URL: http://svn.apache.org/viewvc?rev=1362392&view=rev
Log:
Fix a bug with creating a record for the actual domain name in the Rackspace
DNS driver. Reported by Matt Perry, part of LIBCLOUD-224.

Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/dns/drivers/rackspace.py
    libcloud/trunk/libcloud/test/dns/test_rackspace.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1362392&r1=1362391&r2=1362392&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Tue Jul 17 07:43:24 2012
@@ -93,6 +93,11 @@ Changes with Apache Libcloud in developm
     - Add support for URL RecordType to Zerigo driver. ; LIBCLOUD-209
       [Bojan Mihelac]
 
+    - Properly handle record creation when user doesn't provider a record name
+      and wants to create a record for the actual domain.
+      Reported by Matt Perry ; LIBCLOUD-224
+      [Tomaz Muraus]
+
   *) Storage
 
     - Fix a bug with Python 3 support in the following drivers ; LIBCLOUD-204

Modified: libcloud/trunk/libcloud/dns/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/dns/drivers/rackspace.py?rev=1362392&r1=1362391&r2=1362392&view=diff
==============================================================================
--- libcloud/trunk/libcloud/dns/drivers/rackspace.py (original)
+++ libcloud/trunk/libcloud/dns/drivers/rackspace.py Tue Jul 17 07:43:24 2012
@@ -363,7 +363,11 @@ class RackspaceDNSDriver(DNSDriver, Open
         @param name: Record name.
         @type name: C{str}
         """
-        name = '%s.%s' % (name, domain)
+        if name:
+            name = '%s.%s' % (name, domain)
+        else:
+            name = domain
+
         return name
 
     def _to_partial_record_name(self, domain, name):

Modified: libcloud/trunk/libcloud/test/dns/test_rackspace.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/dns/test_rackspace.py?rev=1362392&r1=1362391&r2=1362392&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/dns/test_rackspace.py (original)
+++ libcloud/trunk/libcloud/test/dns/test_rackspace.py Tue Jul 17 07:43:24 2012
@@ -296,6 +296,18 @@ class RackspaceUSTests(unittest.TestCase
         else:
             self.fail('Exception was not thrown')
 
+    def test_to_full_record_name_name_provided(self):
+        domain = 'foo.bar'
+        name = 'test'
+        self.assertEquals(self.driver._to_full_record_name(domain, name),
+                          'test.foo.bar')
+
+    def test_to_full_record_name_name_not_provided(self):
+        domain = 'foo.bar'
+        name = None
+        self.assertEquals(self.driver._to_full_record_name(domain, name),
+                          'foo.bar')
+
 
 class RackspaceUK1Tests(RackspaceUSTests):
     klass = RackspaceUKDNSDriver



Mime
View raw message