renamed API Key to API Token
This commit is contained in:
parent
e95018240c
commit
9ffa3cd076
9
app.py
9
app.py
@ -7,9 +7,9 @@ from pathlib import Path
|
||||
from apicalls import *
|
||||
|
||||
|
||||
# Get API key and Email address
|
||||
# Get API tocken and Email address
|
||||
def getCredentials():
|
||||
api_key = input("Enter the Cloudflare API key: ")
|
||||
api_key = input("Enter the Cloudflare API token: ")
|
||||
email_address = input("Enter the Cloudflare Email address: ")
|
||||
return {"api_key": api_key, "email": email_address}
|
||||
|
||||
@ -20,7 +20,8 @@ if len(argv) > 1 and 'loadconfig' in argv:
|
||||
if Path("config.json").exists():
|
||||
configfile = open("config.json")
|
||||
config = json.load(configfile)
|
||||
credentials = {'api_key': config['API_Key'], 'email': config['Email']}
|
||||
credentials = {
|
||||
'api_key': config['API_Token'], 'email': config['Email']}
|
||||
else:
|
||||
print('config.json was not found. Please enter the credentials manually')
|
||||
credentials = getCredentials()
|
||||
@ -73,4 +74,4 @@ if domainToDelete in zone_list:
|
||||
else:
|
||||
print('Aborted, bye...')
|
||||
else:
|
||||
print('We don\'t have access to the domain name you have entered. Please make sure the API key you have provided has access to the domain name you have entereed.')
|
||||
print('We don\'t have access to the domain name you have entered. Please make sure the API token you have provided has access to the domain name you have entereed.')
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"API_Key": "your api key goes here",
|
||||
"API_Token": "your api key goes here",
|
||||
"Email": "your cloudflare email address"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user