From 648a394f7a318443dfd82f790f83a79616c26905 Mon Sep 17 00:00:00 2001 From: yayogev Date: Tue, 27 Feb 2018 17:00:05 +0200 Subject: US3541 merge various fixes to OPNFV branch timestamp of last commit tt was merged: 26-Jan-2018 16:25. Change-Id: I7b0bf7885d7d0badb81c794a52c480b905d78459 Signed-off-by: yayogev --- app/install/calipso-installer.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'app/install/calipso-installer.py') diff --git a/app/install/calipso-installer.py b/app/install/calipso-installer.py index 78bb927..ad2b4e0 100644 --- a/app/install/calipso-installer.py +++ b/app/install/calipso-installer.py @@ -16,7 +16,12 @@ import dockerpycreds # note : not used, useful for docker api security if used import time import json - +import socket +# by default, we want to use the docker0 interface ip address for inter-contatiner communications, +# if hostname argument will not be provided as argument for the calipso-installer +import os +dockerip = os.popen('ip addr show docker0 | grep "\" | awk \'{ print $2 }\' | awk -F "/" \'{ print $1 }\'') +local_hostname = dockerip.read().replace("\n", "") C_MONGO_CONFIG = "/local_dir/calipso_mongo_access.conf" H_MONGO_CONFIG = "/home/calipso/calipso_mongo_access.conf" @@ -161,7 +166,8 @@ def start_mongo(dbport, copy): copy_file("clique_types") copy_file("cliques") copy_file("constants") - copy_file("environments_config") + copy_file("environments_config"), + copy_file("environment_options"), copy_file("inventory") copy_file("link_types") copy_file("links") @@ -328,10 +334,10 @@ def container_stop(container_name): # parser for getting optional command arguments: parser = argparse.ArgumentParser() parser.add_argument("--hostname", - help="Hostname or IP address of the server " - "(default=172.17.0.1)", + help="FQDN (ex:mysrv.cisco.com) or IP address of the Server" + "(default=docker0 interface ip address)", type=str, - default="172.17.0.1", + default=local_hostname, required=False) parser.add_argument("--webport", help="Port for the Calipso WebUI " @@ -401,6 +407,8 @@ parser.add_argument("--copy", required=False) args = parser.parse_args() +print("\nrunning installer against host:", args.hostname, "\n") + if args.command == "start-all": container = "all" action = "start" @@ -424,6 +432,7 @@ while container != "all" and container not in container_names: if container == "q": exit() + # starting the containers per arguments: if action == "start": # building /home/calipso/calipso_mongo_access.conf and -- cgit 1.2.3-korg