Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
json
Browse files Browse the repository at this point in the history
  • Loading branch information
rwillard committed Feb 11, 2016
1 parent 4e3b67d commit 1611fc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sidekick.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import time
import socket
import sys
import json

from docker import Client
from docker.utils import kwargs_from_env
Expand Down Expand Up @@ -97,9 +98,9 @@ def announce_services( services, etcd_folder, etcd_client, timeout , ttl, vulcan
etcd_client.delete( frontend )
else:
# Announce this server to ETCD
etcd_client.write( backend, {"Type": value['type']})
etcd_client.write( server, {"URL": "http://{0!s}:{1!s}".format(value['ip'], value['port'])})
etcd_client.write( frontend, {"Type": value['type'], "BackendId": key, "Route": "Host(`{0}`)".format(value['domain'])})
etcd_client.write( backend, json.dumps({"Type": value['type']}), ttl=ttl)
etcd_client.write( server, json.dumps({"URL": "http://{0!s}:{1!s}".format(value['ip'], value['port'])}), ttl=ttl)
etcd_client.write( frontend, json.dumps({"Type": value['type'], "BackendId": key, "Route": "Host(`{0}`)".format(value['domain'])}), ttl=ttl)
except etcd.EtcdException as e:
logging.error( e )

Expand Down

0 comments on commit 1611fc8

Please sign in to comment.