Skip to content

Commit

Permalink
Changed os.environ.get(var, None) to os.environ[var] everywhere and r…
Browse files Browse the repository at this point in the history
…emoved obsolete comments.
  • Loading branch information
danalex97 committed Aug 9, 2017
1 parent 2d74fff commit 79e808a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions aimmo-game-creator/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

def main():
logging.basicConfig(level=logging.DEBUG)
WorkerManagerClass = WORKER_MANAGERS[os.environ.get('WORKER_MANAGER', None)]
worker_manager = WorkerManagerClass(os.environ.get('GAME_API_URL', None))
WorkerManagerClass = WORKER_MANAGERS[os.environ['WORKER_MANAGER']]
worker_manager = WorkerManagerClass(os.environ['GAME_API_URL'])
worker_manager.run()

if __name__ == '__main__':
Expand Down
5 changes: 1 addition & 4 deletions aimmo-game/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def run_game(port):
print("Running game...")
settings = pickle.loads(os.environ['settings'])

# TODO: this does not work with Kubernates; locally it works
# as http://localhost:8000/players/api/games/ is used as default
api_url = os.environ.get('GAME_API_URL', None)
api_url = os.environ['GAME_API_URL']
if hasattr(custom_map, settings['GENERATOR']):
generator = getattr(custom_map, settings['GENERATOR'])(settings)
else:
Expand All @@ -158,7 +156,6 @@ def run_game(port):

run_game(int(sys.argv[2]))

# run the flusk persistent connection
socketio.run(
app,
debug=False,
Expand Down

0 comments on commit 79e808a

Please sign in to comment.