Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
removed redudant code and confirmed extra code would work from an env…
Browse files Browse the repository at this point in the history
… variable
  • Loading branch information
mahtin committed Jul 4, 2016
1 parent 7c84046 commit 4747180
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions CloudFlare/read_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,27 @@ def read_configs():
email = re.sub(r"\s+", '', config.get('CloudFlare', 'email'))
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, 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, ConfigParser.NoSectionError):
certtoken = None
except ConfigParser.NoSectionError:
certtoken = None

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

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

return [email, token, certtoken, extras]

0 comments on commit 4747180

Please sign in to comment.