Skip to content

Commit

Permalink
removed duplicate code because of multipul PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Jul 4, 2016
2 parents 0e6a6fe + 6272de8 commit 1641115
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CloudFlare/read_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,30 @@ def read_configs():
if email is None:
try:
email = re.sub(r"\s+", '', config.get('CloudFlare', 'email'))
except ConfigParser.NoOptionError:
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
email = None
except ConfigParser.NoSectionError:
email = None

if token is None:
try:
token = re.sub(r"\s+", '', config.get('CloudFlare', 'token'))
except ConfigParser.NoOptionError:
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
token = None
except ConfigParser.NoSectionError:
token = None

if certtoken is None:
try:
certtoken = re.sub(r"\s+", '', config.get('CloudFlare', 'certtoken'))
except ConfigParser.NoOptionError:
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
certtoken = None
except ConfigParser.NoSectionError:
certtoken = None

try:
extras = re.sub(r"\s+", ' ', config.get('CloudFlare', 'extras'))
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
extras = None
except ConfigParser.NoSectionError:
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
extras = None

if extras:
Expand Down

0 comments on commit 1641115

Please sign in to comment.