summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Verboso <fverboso@unime.it>2018-12-11 12:55:24 +0100
committerFabio Verboso <fverboso@unime.it>2018-12-11 12:55:24 +0100
commit501f930284225385b991409f72e6abd87eb03972 (patch)
treeaabf25ca31fd80013d827a08979b41841ab539b6
parentd1ebff90342e2dfee677b68b60e503109edb7b03 (diff)
Resolve ip from wamp url
Designate record requires an ip address and the wampagent hostname must be resolved. Change-Id: Ief4267c9b11063134941341dff3c7e725e92ee2d
Notes
Notes (review): Code-Review+2: Fabio Verboso <fverboso@unime.it> Workflow+1: Fabio Verboso <fverboso@unime.it> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 11 Dec 2018 12:13:56 +0000 Reviewed-on: https://review.openstack.org/624371 Project: openstack/iotronic Branch: refs/heads/master
-rw-r--r--iotronic/conductor/endpoints.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/iotronic/conductor/endpoints.py b/iotronic/conductor/endpoints.py
index 8602dab..cf3ddc2 100644
--- a/iotronic/conductor/endpoints.py
+++ b/iotronic/conductor/endpoints.py
@@ -32,6 +32,7 @@ from oslo_config import cfg
32from oslo_log import log as logging 32from oslo_log import log as logging
33import oslo_messaging 33import oslo_messaging
34import random 34import random
35import socket
35 36
36LOG = logging.getLogger(__name__) 37LOG = logging.getLogger(__name__)
37 38
@@ -71,7 +72,8 @@ def manage_result(res, wamp_rpc_call, board_uuid):
71def create_record_dns_webservice(ctx, board, webs_name, board_dns, zone): 72def create_record_dns_webservice(ctx, board, webs_name, board_dns, zone):
72 agent = objects.WampAgent.get_by_hostname(ctx, board.agent) 73 agent = objects.WampAgent.get_by_hostname(ctx, board.agent)
73 wsurl = agent.wsurl 74 wsurl = agent.wsurl
74 ip = wsurl.split("//")[1].split(":")[0] 75 w_host = wsurl.split("//")[1].split(":")[0]
76 ip = socket.gethostbyname(w_host)
75 77
76 LOG.debug('Create dns record %s for board %s', 78 LOG.debug('Create dns record %s for board %s',
77 webs_name + "." + board_dns + "." + zone, 79 webs_name + "." + board_dns + "." + zone,
@@ -86,7 +88,8 @@ def create_record_dns_webservice(ctx, board, webs_name, board_dns, zone):
86def create_record_dns(ctx, board, board_dns, zone): 88def create_record_dns(ctx, board, board_dns, zone):
87 agent = objects.WampAgent.get_by_hostname(ctx, board.agent) 89 agent = objects.WampAgent.get_by_hostname(ctx, board.agent)
88 wsurl = agent.wsurl 90 wsurl = agent.wsurl
89 ip = wsurl.split("//")[1].split(":")[0] 91 w_host = wsurl.split("//")[1].split(":")[0]
92 ip = socket.gethostbyname(w_host)
90 93
91 LOG.debug('Create dns record %s for board %s', 94 LOG.debug('Create dns record %s for board %s',
92 board_dns + "." + zone, 95 board_dns + "." + zone,