From 27ec57adbf7f9d1a5bd4f41805adc1cb836690e0 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Mon, 14 Oct 2019 21:17:34 +0000 Subject: [PATCH] Added login_test method --- lib/directadmin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/directadmin.py b/lib/directadmin.py index 176c2e3..cc159bb 100644 --- a/lib/directadmin.py +++ b/lib/directadmin.py @@ -60,6 +60,14 @@ class DirectAdminClient: 'message': response['text'][0] } + def login_test(self): + r = self.make_request('CMD_API_LOGIN_TEST') + response = parse_qs(r.read().decode('utf8'), + keep_blank_values=0, + strict_parsing=1) + + return self.__process_response__(response) + def get_domain_list(self): r = self.make_request('CMD_API_SHOW_DOMAINS') @@ -86,6 +94,7 @@ class DirectAdminClient: ('value', record_value)]) if record_ttl is not None: + # Non-default is specified so we should add on the record params.update({'ttl': record_ttl}) response = self.make_request('CMD_API_DNS_CONTROL', data=params) @@ -105,6 +114,7 @@ class DirectAdminClient: ('value', record_value_new)]) if record_ttl is not None: + # Non-default is specified so we should add on the record params.update({'ttl': record_ttl}) response = self.make_request('CMD_API_DNS_CONTROL', data=params)