Skip to content

Commit

Permalink
Updated 'update_js_config' to work remotely
Browse files Browse the repository at this point in the history
Bug #1587805

Change-Id: I73a0fb4c70168c663a229225cf045720e6369c9f
  • Loading branch information
pavanap committed Jun 1, 2016
1 parent 0e8f5a6 commit 5efaee6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fabfile/tasks/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,12 +1048,12 @@ def update_js_config(role, file_path, service):
"""Task to update config of any section in a js file
USAGE:fab update_js_config:openstack,/etc/contrail/config.global.js,contrail-webui
"""
with open(file_path, 'a') as fo:
fo.write('config.session = {};\n')
fo.write('config.session.timeout = 24 * 60 * 60 * 1000;\n')
fo.close()
cmd = "service " + service + " restart"
cmd1 = "echo 'config.session = {};' >> " + file_path
cmd2 = "echo 'config.session.timeout = 86400 * 1000;' >> " + file_path
cmd3 = "service " + service + " restart"
for host in env.roledefs[role]:
with settings(host_string=host, password=get_env_passwords(host)):
sudo(cmd)
sudo(cmd1)
sudo(cmd2)
sudo(cmd3)
# end update_js_config

0 comments on commit 5efaee6

Please sign in to comment.