Skip to content

Commit d2d270e

Browse files
author
Matthew Fisher
committed
fix(router): use string instead of JSON
This format can be consumed without structured data handling. For example, bash has no builtin commands which handle JSON data structures.
1 parent a7ea4a0 commit d2d270e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

router/bin/boot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if [[ ! -z $EXTERNAL_PORT ]]; then
8585

8686
# while the port is listening, publish to etcd
8787
while [[ ! -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PORT\" && \$1 ~ \"$PROTO.?\"") ]] ; do
88-
etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH "{'host': '$HOST', 'port': $EXTERNAL_PORT}" --ttl $ETCD_TTL >/dev/null
88+
etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH "$HOST:$EXTERNAL_PORT" --ttl $ETCD_TTL >/dev/null
8989
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
9090
done
9191

router/tests/router_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestRouter(t *testing.T) {
6262
etcdutils.VerifyEtcdValue(t, "/deis/router/gzip", "on", etcdPort)
6363
etcdutils.VerifyEtcdValue(t,
6464
"/deis/router/hosts/"+host,
65-
fmt.Printf("{'host': '%s', 'port': %d}", host, port),
65+
fmt.Sprintf("%s:%s", host, port),
6666
etcdPort)
6767
_ = cli.CmdRm("-f", name)
6868
}

0 commit comments

Comments
 (0)