Jelajahi Sumber

chore(api): renamed variables to deshadow 'type'

Nils Wisiol 8 tahun lalu
induk
melakukan
781319bcf6
1 mengubah file dengan 6 tambahan dan 6 penghapusan
  1. 6 6
      api/desecapi/pdns.py

+ 6 - 6
api/desecapi/pdns.py

@@ -69,7 +69,7 @@ def _pdns_put(url):
     return r
     return r
 
 
 
 
-def _delete_or_replace_rrset(name, type, value, ttl=60):
+def _delete_or_replace_rrset(name, rr_type, value, ttl=60):
     """
     """
     Return pdns API json to either replace or delete a record set, depending on whether value is empty or not.
     Return pdns API json to either replace or delete a record set, depending on whether value is empty or not.
     """
     """
@@ -78,7 +78,7 @@ def _delete_or_replace_rrset(name, type, value, ttl=60):
             {
             {
                 "records": [
                 "records": [
                     {
                     {
-                        "type": type,
+                        "type": rr_type,
                         "name": name,
                         "name": name,
                         "disabled": False,
                         "disabled": False,
                         "content": value,
                         "content": value,
@@ -86,14 +86,14 @@ def _delete_or_replace_rrset(name, type, value, ttl=60):
                 ],
                 ],
                 "ttl": ttl,
                 "ttl": ttl,
                 "changetype": "REPLACE",
                 "changetype": "REPLACE",
-                "type": type,
+                "type": rr_type,
                 "name": name,
                 "name": name,
             }
             }
     else:
     else:
         return \
         return \
             {
             {
                 "changetype": "DELETE",
                 "changetype": "DELETE",
-                "type": type,
+                "type": rr_type,
                 "name": name
                 "name": name
             }
             }
 
 
@@ -160,7 +160,7 @@ def set_dyn_records(name, a, aaaa, acme_challenge=''):
     notify_zone(name)
     notify_zone(name)
 
 
 
 
-def set_rrset(zone, name, type, value):
+def set_rrset(zone, name, rr_type, value):
     """
     """
     Commands pdns to set or delete a record set for the zone with the given name.
     Commands pdns to set or delete a record set for the zone with the given name.
     If value is empty, the rrset will be deleted.
     If value is empty, the rrset will be deleted.
@@ -170,6 +170,6 @@ def set_rrset(zone, name, type, value):
 
 
     _pdns_patch('/zones/' + zone, {
     _pdns_patch('/zones/' + zone, {
         "rrsets": [
         "rrsets": [
-            _delete_or_replace_rrset(name, type, value),
+            _delete_or_replace_rrset(name, rr_type, value),
         ]
         ]
     })
     })