Skip to content

Commit

Permalink
Add parameter port in config.json.template
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyHuo committed Jun 29, 2018
1 parent 349e91a commit 2481273
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.json.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"port": 5000,
"node_name": "node01",
"check_interval": 300,
"yarn": {
Expand Down
8 changes: 6 additions & 2 deletions guardian.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def command_check(args):
while True:

config = get_args_check(args)
print
alert_client = GuardianAlert(config["alert_manager"])
check_impl(config, alert_client)
time.sleep(config['check_interval'])
Expand Down Expand Up @@ -408,10 +407,15 @@ def match(s):
t.setDaemon(True)
t.start()

config = get_args_check(sys.argv[2])
port = 5000
if 'port' in config:
port = config['port']

app = config_api.app
app.config['config_name'] = sys.argv[2]

app.run(host='0.0.0.0')
app.run(host='0.0.0.0', port=port)

elif command == 'inspect':
config = get_args_inspect(sys.argv[2:])
Expand Down

0 comments on commit 2481273

Please sign in to comment.