Skip to content

Commit

Permalink
Fixing a bug with logging when generating config
Browse files Browse the repository at this point in the history
This commit fixes a bug where config generation tries to log with
a logger that doesn't exist yet.  Instead we'll print.
  • Loading branch information
Travis McPeak committed Jun 27, 2017
1 parent b1dfe25 commit 70ad391
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions repokid/repokid.py
Expand Up @@ -128,9 +128,9 @@ def _generate_default_config(filename=None):
with open(filename, 'w') as f:
json.dump(config_dict, f, indent=4, sort_keys=True)
except OSError as e:
LOGGER.error("Unable to open {} for writing: {}".format(filename, e.message))
print("Unable to open {} for writing: {}".format(filename, e.message))
else:
LOGGER.info("Successfully wrote sample config to {}".format(filename))
print("Successfully wrote sample config to {}".format(filename))
return config_dict


Expand Down Expand Up @@ -754,7 +754,8 @@ def main():

if args.get('config'):
config_filename = args.get('<config_filename>')
return _generate_default_config(filename=config_filename)
_generate_default_config(filename=config_filename)
sys.exit(0)

account_number = args.get('<account_number>')
_init_config(account_number)
Expand Down

0 comments on commit 70ad391

Please sign in to comment.