Fixed missing parameter bug

This commit is contained in:
Anon 2022-10-21 19:19:19 -07:00
parent 2ecff9e0d5
commit b16d6ca175

View File

@ -41,7 +41,7 @@ class CloudflairAPI:
def get_missing_config_var(self): def get_missing_config_var(self):
keys = ("domain_name", "cf_api_key", "cf_zone_id", "cf_record_id") keys = ("domain_name", "cf_api_key", "cf_zone_id", "cf_record_id")
missing_parameter = next( missing_parameter = next(
(key for key in keys if getattr(self, key) is None), (key for key in keys if not getattr(self, key)),
None None
) )
return missing_parameter return missing_parameter
@ -225,8 +225,4 @@ def main():
# 0 - Success # 0 - Success
# 1 - An error occurred # 1 - An error occurred
if __name__ == "__main__": if __name__ == "__main__":
try:
sys.exit(main()) sys.exit(main())
except Exception as e:
print("Exception!!", e)
sys.exit(1)