Repository: AnalogJ/lexicon

Issue:
function update_record() in namesilo.py has wrong query parameter
origin: data['rdata'] = content
modified: data['rrvalue'] = content


Discussion:
hmm, thanks for this. Are you referencing line https://github.com/AnalogJ/lexicon/blob/master/lexicon/providers/namesilo.py#L78 ?

Resolving patch:
diff --git a/lexicon/providers/namesilo.py b/lexicon/providers/namesilo.py
--- a/lexicon/providers/namesilo.py
+++ b/lexicon/providers/namesilo.py
@@ -75,7 +75,7 @@ def update_record(self, identifier, type=None, name=None, content=None):
         if name:
             data['rrhost'] = self._relative_name(name)
         if content:
-            data['rdata'] = content
+            data['rrvalue'] = content
         if self.options.get('ttl'):
             data['rrttl'] = self.options.get('ttl')
 
@@ -124,4 +124,4 @@ def _request(self, action='GET',  url='/', data=None, query_params=None):
             raise Exception('An error occurred: {0}, {1}'.format(root.find('reply').find('detail').text, root.find('reply').find('code').text))
 
 
-        return root
\ No newline at end of file
+        return root


Test patch:
diff --git a/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_should_modify_record.yaml b/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_should_modify_record.yaml
--- a/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_should_modify_record.yaml
+++ b/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_should_modify_record.yaml
@@ -7,7 +7,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/getDomainInfo?domain=capsulecdfake.com&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/getDomainInfo?domain=capsulecdfake.com&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -36,7 +36,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsAddRecord?rrvalue=challengetoken&domain=capsulecdfake.com&rrhost=orig.test&rrtype=TXT&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsAddRecord?domain=capsulecdfake.com&rrhost=orig.test&rrtype=TXT&rrvalue=challengetoken&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -64,7 +64,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsListRecords?domain=capsulecdfake.com&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsListRecords?domain=capsulecdfake.com&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -92,7 +92,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrhost=updated.test&rrid=bced899e905a49bbab479f7827683dca&version=1&rdata=challengetoken&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrvalue=challengetoken&rrhost=updated.test&rrid=bced899e905a49bbab479f7827683dca&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -113,4 +113,34 @@ interactions:
       vary: [Accept-Encoding]
       x-proxy-cache: [MISS]
     status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      User-Agent: [python-requests/2.13.0]
+    method: GET
+    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrhost=updated.test&rrid=bced899e905a49bbab479f7827683dca&rrvalue=challengetoken&type=xml&version=1
+  response:
+    body: {string: !!python/unicode '<?xml version="1.0"?>
+
+        <namesilo><request><operation>dnsUpdateRecord</operation><ip>208.72.142.184</ip></request><reply><code>110</code><detail>Invalid
+        API Key</detail></reply></namesilo>
+
+        '}
+    headers:
+      cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0']
+      connection: [keep-alive]
+      content-length: ['187']
+      content-type: [text/xml]
+      date: ['Sat, 01 Apr 2017 21:09:37 GMT']
+      expires: ['Thu, 19 Nov 1981 08:52:00 GMT']
+      pragma: [no-cache]
+      server: [nginx]
+      set-cookie: [PHPSESSID=nj52b473j28285ioceoenh2floahkrqg; path=/; domain=dev.namesilo.com]
+      transfer-encoding: [chunked]
+      vary: [Accept-Encoding]
+      x-proxy-cache: [MISS]
+    status: {code: 200, message: OK}
 version: 1
diff --git a/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml b/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml
--- a/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml
+++ b/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_fqdn_name_should_modify_record.yaml
@@ -7,7 +7,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/getDomainInfo?domain=capsulecdfake.com&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/getDomainInfo?domain=capsulecdfake.com&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -36,7 +36,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsAddRecord?rrvalue=challengetoken&domain=capsulecdfake.com&rrhost=orig.testfqdn&rrtype=TXT&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsAddRecord?domain=capsulecdfake.com&rrhost=orig.testfqdn&rrtype=TXT&rrvalue=challengetoken&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -64,7 +64,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsListRecords?domain=capsulecdfake.com&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsListRecords?domain=capsulecdfake.com&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -92,7 +92,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrhost=updated.testfqdn&rrid=423d488cc8d1007f5e7285bd825c35cb&version=1&rdata=challengetoken&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrvalue=challengetoken&rrhost=updated.testfqdn&rrid=423d488cc8d1007f5e7285bd825c35cb&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -113,4 +113,34 @@ interactions:
       vary: [Accept-Encoding]
       x-proxy-cache: [MISS]
     status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      User-Agent: [python-requests/2.13.0]
+    method: GET
+    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrhost=updated.testfqdn&rrid=423d488cc8d1007f5e7285bd825c35cb&rrvalue=challengetoken&type=xml&version=1
+  response:
+    body: {string: !!python/unicode '<?xml version="1.0"?>
+
+        <namesilo><request><operation>dnsUpdateRecord</operation><ip>208.72.142.184</ip></request><reply><code>110</code><detail>Invalid
+        API Key</detail></reply></namesilo>
+
+        '}
+    headers:
+      cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0']
+      connection: [keep-alive]
+      content-length: ['187']
+      content-type: [text/xml]
+      date: ['Sat, 01 Apr 2017 21:09:38 GMT']
+      expires: ['Thu, 19 Nov 1981 08:52:00 GMT']
+      pragma: [no-cache]
+      server: [nginx]
+      set-cookie: [PHPSESSID=dfia4v4v76j8cuut8r4dgaplm4lhceks; path=/; domain=dev.namesilo.com]
+      transfer-encoding: [chunked]
+      vary: [Accept-Encoding]
+      x-proxy-cache: [MISS]
+    status: {code: 200, message: OK}
 version: 1
diff --git a/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_full_name_should_modify_record.yaml b/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_full_name_should_modify_record.yaml
--- a/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_full_name_should_modify_record.yaml
+++ b/tests/fixtures/cassettes/namesilo/IntegrationTests/test_Provider_when_calling_update_record_with_full_name_should_modify_record.yaml
@@ -7,7 +7,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/getDomainInfo?domain=capsulecdfake.com&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/getDomainInfo?domain=capsulecdfake.com&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -36,7 +36,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsAddRecord?rrvalue=challengetoken&domain=capsulecdfake.com&rrhost=orig.testfull&rrtype=TXT&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsAddRecord?domain=capsulecdfake.com&rrhost=orig.testfull&rrtype=TXT&rrvalue=challengetoken&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -64,7 +64,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsListRecords?domain=capsulecdfake.com&version=1&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsListRecords?domain=capsulecdfake.com&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -92,7 +92,7 @@ interactions:
       Connection: [keep-alive]
       User-Agent: [python-requests/2.9.1]
     method: GET
-    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrhost=updated.testfull&rrid=31605c1f92d7d9bb45bf3d81858e6048&version=1&rdata=challengetoken&type=xml
+    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrvalue=challengetoken&rrhost=updated.testfull&rrid=31605c1f92d7d9bb45bf3d81858e6048&type=xml&version=1
   response:
     body: {string: !!python/unicode '<?xml version="1.0"?>
 
@@ -113,4 +113,34 @@ interactions:
       vary: [Accept-Encoding]
       x-proxy-cache: [MISS]
     status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      User-Agent: [python-requests/2.13.0]
+    method: GET
+    uri: http://sandbox.namesilo.com/api/dnsUpdateRecord?domain=capsulecdfake.com&rrhost=updated.testfull&rrid=31605c1f92d7d9bb45bf3d81858e6048&rrvalue=challengetoken&type=xml&version=1
+  response:
+    body: {string: !!python/unicode '<?xml version="1.0"?>
+
+        <namesilo><request><operation>dnsUpdateRecord</operation><ip>208.72.142.184</ip></request><reply><code>110</code><detail>Invalid
+        API Key</detail></reply></namesilo>
+
+        '}
+    headers:
+      cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0']
+      connection: [keep-alive]
+      content-length: ['187']
+      content-type: [text/xml]
+      date: ['Sat, 01 Apr 2017 21:09:38 GMT']
+      expires: ['Thu, 19 Nov 1981 08:52:00 GMT']
+      pragma: [no-cache]
+      server: [nginx]
+      set-cookie: [PHPSESSID=hna306ni5vvdghoc7ahlt2ja4a0en4oj; path=/; domain=dev.namesilo.com]
+      transfer-encoding: [chunked]
+      vary: [Accept-Encoding]
+      x-proxy-cache: [MISS]
+    status: {code: 200, message: OK}
 version: 1