Skip to content

Commit 481bf86

Browse files
authored
Merge pull request #18 from elgris/announcement_bug
Fixes a bug with connecting to the agent
2 parents 509a1dc + 396a9ec commit 481bf86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

instana/fsm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def lookup_agent_host(self, e):
6666
else:
6767
host = self.get_default_gateway()
6868
if host:
69-
self.check_host(host)
69+
h = self.check_host(host)
7070
if h == a.AGENT_HEADER:
7171
self.agent.set_host(host)
7272
self.fsm.announce()
@@ -81,7 +81,7 @@ def get_default_gateway(self):
8181

8282
try:
8383
proc = subprocess.Popen(
84-
"/sbin/ip route | awk '/default/ { print $3 }'", stdout=subprocess.PIPE)
84+
"/sbin/ip route | awk '/default/' | cut -d ' ' -f 3 | tr -d '\n'", shell=True, stdout=subprocess.PIPE)
8585

8686
return proc.stdout.read()
8787
except Exception as e:

0 commit comments

Comments
 (0)