mirror of
https://github.com/stryan/gandi-live-dns.git
synced 2024-11-22 21:35:45 -05:00
text encoding
This commit is contained in:
parent
9288aa5857
commit
aab918351f
@ -1,10 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
api_secret = os.environ.get("GANDI_API_SECRET", "TOKEN")
|
api_secret = os.environ.get("GANDI_API_SECRET", "TOKEN").replace("\"","")
|
||||||
api_endpoint = os.environ.get("GANDI_API_ENDPOINT",'https://dns.api.gandi.net/api/v5')
|
api_endpoint = os.environ.get("GANDI_API_ENDPOINT",'https://dns.api.gandi.net/api/v5').replace("\"","")
|
||||||
|
|
||||||
static_ip = os.environ.get("GANDI_STATIC_IP","")
|
static_ip = os.environ.get("GANDI_STATIC_IP","").replace("\"","")
|
||||||
domain = os.environ.get("GANDI_DOMAIN","")
|
domain = os.environ.get("GANDI_DOMAIN","").replace("\"","")
|
||||||
subdomains = os.environ.get("GANDI_SUBDOMAINS","").split(",")
|
subdomains = os.environ.get("GANDI_SUBDOMAINS","").replace("\"","").split(",")
|
||||||
ttl = os.environ.get("GANDI_TIMEOUT","300")
|
ttl = os.environ.get("GANDI_TIMEOUT","300").replace("\"","")
|
||||||
ifconfig = os.environ.get("GANDI_IFCONFIG","https://ifconfig.co/ip")
|
ifconfig = os.environ.get("GANDI_IFCONFIG","https://ifconfig.co/ip").replace("\"","")
|
||||||
|
@ -59,8 +59,8 @@ def get_dnsip(uuid):
|
|||||||
u = requests.get(url, headers=headers)
|
u = requests.get(url, headers=headers)
|
||||||
if u.status_code == 200:
|
if u.status_code == 200:
|
||||||
json_object = json.loads(u._content)
|
json_object = json.loads(u._content)
|
||||||
print('Checking IP from DNS Record' , config.subdomains[0], ':', json_object['rrset_values'][0].encode('ascii','ignore').strip('\n'))
|
print('Checking IP from DNS Record' , config.subdomains[0], ':', json_object['rrset_values'][0].encode('ascii','ignore').decode().strip('\n'))
|
||||||
return json_object['rrset_values'][0].encode('ascii','ignore').strip('\n')
|
return json_object['rrset_values'][0].strip('\n')
|
||||||
else:
|
else:
|
||||||
print('Error: HTTP Status Code ', u.status_code, 'when trying to get IP from subdomain', config.subdomains[0])
|
print('Error: HTTP Status Code ', u.status_code, 'when trying to get IP from subdomain', config.subdomains[0])
|
||||||
print(json_object['message'])
|
print(json_object['message'])
|
||||||
@ -96,7 +96,6 @@ def main(force_update, verbosity):
|
|||||||
if verbosity:
|
if verbosity:
|
||||||
print("verbosity turned on - not implemented by now")
|
print("verbosity turned on - not implemented by now")
|
||||||
|
|
||||||
|
|
||||||
#get zone ID from Account
|
#get zone ID from Account
|
||||||
uuid = get_uuid()
|
uuid = get_uuid()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user