|
|
@ -70,8 +70,7 @@ def run_complete(shell: Union[None, str]):
|
|
|
|
elif shell == "fish":
|
|
|
|
elif shell == "fish":
|
|
|
|
os.system("register-python-argcomplete --shell fish knotctl")
|
|
|
|
os.system("register-python-argcomplete --shell fish knotctl")
|
|
|
|
elif shell == "tcsh":
|
|
|
|
elif shell == "tcsh":
|
|
|
|
os.system("register-python-argcomplete --shell tcsh knotctl",
|
|
|
|
os.system("register-python-argcomplete --shell tcsh knotctl")
|
|
|
|
shell=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_config(
|
|
|
|
def run_config(
|
|
|
@ -214,8 +213,11 @@ def main() -> int:
|
|
|
|
if not isdir(config_basepath):
|
|
|
|
if not isdir(config_basepath):
|
|
|
|
mkdir(config_basepath)
|
|
|
|
mkdir(config_basepath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.command == "config":
|
|
|
|
|
|
|
|
run_config(args.baseurl, args.username, args.password)
|
|
|
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
if not isfile(config_filename):
|
|
|
|
if not isfile(config_filename):
|
|
|
|
if args.command != "config":
|
|
|
|
|
|
|
|
print("You need to configure knotctl before proceeding")
|
|
|
|
print("You need to configure knotctl before proceeding")
|
|
|
|
run_config(config_filename)
|
|
|
|
run_config(config_filename)
|
|
|
|
|
|
|
|
|
|
|
@ -241,8 +243,6 @@ def main() -> int:
|
|
|
|
url = setup_url(baseurl, args.data, args.name, args.rtype, ttl, args.zone)
|
|
|
|
url = setup_url(baseurl, args.data, args.name, args.rtype, ttl, args.zone)
|
|
|
|
if args.command == "add":
|
|
|
|
if args.command == "add":
|
|
|
|
run_add(url, args.json, headers)
|
|
|
|
run_add(url, args.json, headers)
|
|
|
|
elif args.command == "config":
|
|
|
|
|
|
|
|
run_config(args.baseurl, args.username, args.password)
|
|
|
|
|
|
|
|
elif args.command == "delete":
|
|
|
|
elif args.command == "delete":
|
|
|
|
run_delete(url, args.json, headers)
|
|
|
|
run_delete(url, args.json, headers)
|
|
|
|
elif args.command == "list":
|
|
|
|
elif args.command == "list":
|
|
|
|