Skip to content

Commit

Permalink
Merge "config: publish to discovery server only if one configured" in…
Browse files Browse the repository at this point in the history
…to R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jul 10, 2015
2 parents 0045dcb + f2f2822 commit 09345e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/config/api-server/vnc_cfg_api_server.py
Expand Up @@ -1529,17 +1529,19 @@ def publish_self_to_discovery(self):
'ip-address': self._args.ifmap_server_ip,
'port': self._args.listen_port,
}
self.api_server_task = self._disc.publish(
API_SERVER_DISCOVERY_SERVICE_NAME, data)
if self._disc:
self.api_server_task = self._disc.publish(
API_SERVER_DISCOVERY_SERVICE_NAME, data)

def publish_ifmap_to_discovery(self):
# publish ifmap server
data = {
'ip-address': self._args.ifmap_server_ip,
'port': self._args.ifmap_server_port,
}
self.ifmap_task = self._disc.publish(
IFMAP_SERVER_DISCOVERY_SERVICE_NAME, data)
if self._disc:
self.ifmap_task = self._disc.publish(
IFMAP_SERVER_DISCOVERY_SERVICE_NAME, data)
# end publish_ifmap_to_discovery

def un_publish_self_to_discovery(self):
Expand All @@ -1548,15 +1550,17 @@ def un_publish_self_to_discovery(self):
'ip-address': self._args.ifmap_server_ip,
'port': self._args.listen_port,
}
self._disc.un_publish(API_SERVER_DISCOVERY_SERVICE_NAME, data)
if self._disc:
self._disc.un_publish(API_SERVER_DISCOVERY_SERVICE_NAME, data)

def un_publish_ifmap_to_discovery(self):
# un publish ifmap server
data = {
'ip-address': self._args.ifmap_server_ip,
'port': self._args.ifmap_server_port,
}
self._disc.un_publish(IFMAP_SERVER_DISCOVERY_SERVICE_NAME, data)
if self._disc:
self._disc.un_publish(IFMAP_SERVER_DISCOVERY_SERVICE_NAME, data)
# end un_publish_ifmap_to_discovery

# end class VncApiServer
Expand Down
2 changes: 1 addition & 1 deletion src/config/api-server/vnc_cfg_ifmap.py
Expand Up @@ -216,7 +216,7 @@ def _ifmap_dequeue_task(self):
self._publish_to_ifmap_dequeue()
except Exception as e:
tb = utils.detailed_traceback()
self.config_log(tb, level=SandeshLevel.SYS_ERROR)
self.config_log(tb, level=SandeshLevel.SYS_ERR)

def _publish_to_ifmap_dequeue(self):
def _publish(requests, traces, publish_discovery=False):
Expand Down

0 comments on commit 09345e6

Please sign in to comment.