def send_address_to_engine(host, port):
con = context.get_admin_context()
- resp = rpc.call(con, 'engine',
- {'method': 'metadata_register_address',
- 'args': {'url': 'http://%s:%s' % (host, port)}})
+ while True:
+ try:
+ resp = rpc.call(con, 'engine',
+ {'method': 'metadata_register_address',
+ 'args': {'url': 'http://%s:%s' % (host, port)}})
+ LOG.info('registered the hostname and port with the engine.')
+ return
+ except rpc.common.Timeout:
+ LOG.info('Could not connect to the engine, retrying...')
if __name__ == '__main__':