Skip to content

Commit

Permalink
Use control_data ip to make remote_syslog work in multiinterface setup
Browse files Browse the repository at this point in the history
In fabfile/tasks/provision.py, we populate at line 1304 control_data interface ip and
try to access the connect_map_dict with management ip,Which is in a multi interface setup.

Fixed it by using control_ip and  pointing to the correct script location.
Closes-Bug: 1383441

Change-Id: I066f2c258e53b347d3147bfafc8bc80876a9787c
  • Loading branch information
cijohnson committed Oct 20, 2014
1 parent b79d68e commit f4e6ae7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fabfile/tasks/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from time import sleep
from fabric.contrib.files import exists

FAB_UTILS_DIR = '/opt/contrail/utils/fabfile/utils/'

@task
@EXECUTE_TASK
@roles('all')
Expand Down Expand Up @@ -1314,14 +1316,15 @@ def setup_remote_syslog_node(*args):
collector_ips)

for host_string in args:
host_ip = host_string.split('@')[1]
#host_ip = host_string.split('@')[1]
host_ip = hstr_to_ip(get_control_host_string(host_string))
if host_ip == connect_map_dict[host_ip]:
mode = 'receiver'
else:
mode = 'generator'

with settings(host_string=host_string):
with cd(UTILS_DIR):
with cd(FAB_UTILS_DIR):
cmd = "python provision_rsyslog_connect.py "
myopts = "--rsyslog_port_number %s --rsyslog_transport_protocol %s " % (rsyslog_port, rsyslog_proto)
myargs = myopts + "--mode %s --collector_ip %s" % (mode, connect_map_dict[host_ip])
Expand Down Expand Up @@ -1355,15 +1358,16 @@ def cleanup_remote_syslog_node():
default_protocol = 'udp'

for host_string in args:
host_ip = host_string.split('@')[1]
#host_ip = host_string.split('@')[1]
host_ip = hstr_to_ip(get_control_host_string(host_string))
mode = 'generator'
collector_ips = role_to_ip_dict(role='collector')
for each_collector in collector_ips:
if host_ip == each_collector:
mode = 'receiver'

with settings(host_string=host_string):
with cd(UTILS_DIR):
with cd(FAB_UTILS_DIR):
run_cmd = "python provision_rsyslog_connect.py --mode %s --cleanup True" \
% (mode)
run(run_cmd)
Expand Down

0 comments on commit f4e6ae7

Please sign in to comment.