Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 2c4ee60

Browse files
committed
config file processing was messed up
1 parent 456ab7f commit 2c4ee60

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

CloudFlare/cloudflare.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@ def __init__(self, config):
4949
self.network = CFnetwork(use_sessions=self.use_sessions)
5050
self.user_agent = user_agent()
5151

52-
if not isinstance(self.email, str):
53-
raise ValueError('email argument not string')
54-
if not isinstance(self.token, str):
55-
raise ValueError('token argument not string')
56-
if not isinstance(self.certtoken, str):
57-
raise ValueError('certtoken argument not string')
58-
if not isinstance(self.base_url, str):
59-
raise ValueError('base url argument not string')
52+
## We don't need to check this here as we test for
53+
## this when building the authentication headers
54+
##
55+
##if not isinstance(self.email, str):
56+
## raise ValueError('email argument not string')
57+
##if not isinstance(self.token, str):
58+
## raise ValueError('token argument not string')
59+
##if not isinstance(self.certtoken, str):
60+
## raise ValueError('certtoken argument not string')
61+
##if not isinstance(self.base_url, str):
62+
## raise ValueError('base url argument not string')
6063

6164
if 'debug' in config and config['debug']:
6265
self.logger = CFlogger(config['debug']).getLogger()

CloudFlare/read_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def read_configs(profile=None):
1616
# envioronment variables override config files - so setup first
1717
config['email'] = os.getenv('CLOUDFLARE_EMAIL') if os.getenv('CLOUDFLARE_EMAIL') != None else os.getenv('CF_API_EMAIL')
1818
config['token'] = os.getenv('CLOUDFLARE_API_KEY') if os.getenv('CLOUDFLARE_API_KEY') != None else os.getenv('CF_API_KEY')
19-
config['certtoken'] = os.getenv('CLOUDFLARE_API_CERTKEY') if os.getenv('CLOUDFLARE_API_CERTKEY') != None else os.getenv('CF_API_CERTKEY')
19+
config['certtoken'] = os.getenv('CLOUDFLARE_API_CERTKEY') if os.getenv('CLOUDFLARE_API_CERTKEY') != None else os.getenv('CF_API_CERTKEY')
2020
config['extras'] = os.getenv('CLOUDFLARE_API_EXTRAS') if os.getenv('CLOUDFLARE_API_EXTRAS') != None else os.getenv('CF_API_EXTRAS')
2121
config['base_url'] = os.getenv('CLOUDFLARE_API_URL') if os.getenv('CLOUDFLARE_API_URL') != None else os.getenv('CF_API_URL')
2222
if profile is None:

0 commit comments

Comments
 (0)