Skip to content

Commit 0e6a6fe

Browse files
committed
Merge branch 'fix_no_config-20160628-0927' of https://github.com/nicholaskuechler/python-cloudflare
2 parents 53da54b + f7b824f commit 0e6a6fe

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

CloudFlare/read_configs.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,35 @@ def read_configs():
2222
])
2323

2424
if email is None:
25-
email = config.get('CloudFlare', 'email')
2625
try:
2726
email = re.sub(r"\s+", '', config.get('CloudFlare', 'email'))
2827
except ConfigParser.NoOptionError:
2928
email = None
29+
except ConfigParser.NoSectionError:
30+
email = None
3031

3132
if token is None:
3233
try:
3334
token = re.sub(r"\s+", '', config.get('CloudFlare', 'token'))
3435
except ConfigParser.NoOptionError:
3536
token = None
37+
except ConfigParser.NoSectionError:
38+
token = None
3639

3740
if certtoken is None:
3841
try:
3942
certtoken = re.sub(r"\s+", '', config.get('CloudFlare', 'certtoken'))
4043
except ConfigParser.NoOptionError:
4144
certtoken = None
45+
except ConfigParser.NoSectionError:
46+
certtoken = None
4247

4348
try:
4449
extras = re.sub(r"\s+", ' ', config.get('CloudFlare', 'extras'))
4550
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
4651
extras = None
52+
except ConfigParser.NoSectionError:
53+
extras = None
4754

4855
if extras:
4956
extras = extras.split(' ')

0 commit comments

Comments
 (0)