aboutsummaryrefslogtreecommitdiffstats
path: root/process_conf.py
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-03-16 18:38:19 +0800
committerYingjun Li <yingjun.li@huawei.com>2017-03-17 01:32:13 +0000
commitf141c55066c32d1699debebb56394c04d32e69b2 (patch)
tree1c9c6589aabf1602467767d5708a33dee7aa8ebf /process_conf.py
parent6d809ad2460235ff8bc800a6e630c258df785cae (diff)
Add upload packages retry
1. retry 5 times if csar package uploads fail 2. clearwater service name varies over the time 3. use the word vnf instead of app Change-Id: Id85c7f467cbefbc46fd1f1daf6202d89ef3ac898 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com> (cherry picked from commit 8a07bcd6b75f62c7c79504f8a3c020a2d635156e)
Diffstat (limited to 'process_conf.py')
-rw-r--r--process_conf.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/process_conf.py b/process_conf.py
index c8f4e9d..976cf19 100644
--- a/process_conf.py
+++ b/process_conf.py
@@ -24,16 +24,18 @@ def generate_openo_conf(openo_config, scripts_dir):
fd.write('{0}={1}\n'.format(i.upper(), openo_config["openo_docker_net"][i]))
fd.write('{0}={1}\n'.format('OPENO_VERSION', openo_config["openo_version"]))
-
-
-def generate_app_conf(openo_config, app_config, scripts_dir):
- """generate opera/work/scripts_dir/application.conf"""
- with open(scripts_dir + "/application.conf", "w") as fd:
- for i in app_config["application"]:
- if i["name"] == openo_config["application"]:
- fd.write('{0}={1}\n'.format('APP_NAME', i["name"]))
- fd.write('{0}={1}\n'.format('APP_NS_PKG', i["ns_pkg"]))
- fd.write('{0}={1}'.format('APP_VNF_PKG', i["vnf_pkg"]))
+ fd.write('{0}={1}'.format('ENABLE_SDNO', openo_config["enable_sdno"]))
+
+
+def generate_app_conf(openo_config, vnf_config, scripts_dir):
+ """generate opera/work/scripts_dir/vnf.conf"""
+ with open(scripts_dir + "/vnf.conf", "w") as fd:
+ for i in vnf_config["vIMS"]:
+ if i["type"] == openo_config["vnf_type"]:
+ fd.write('{0}={1}\n'.format('VNF_TYPE', i["type"]))
+ fd.write('{0}={1}\n'.format('NS_PKG', i["ns_pkg"]))
+ fd.write('{0}={1}\n'.format('VNF_PKG', i["vnf_pkg"]))
+ fd.write('{0}={1}'.format('NSDID', i["nsdId"]))
break
@@ -42,13 +44,13 @@ if __name__ == "__main__":
print("parameter wrong%d %s" % (len(sys.argv), sys.argv))
sys.exit(1)
- _, openo_file, app_file = sys.argv
+ _, openo_file, vnf_file = sys.argv
if not os.path.exists(openo_file):
print("network.yml doesn't exit")
sys.exit(1)
- if not os.path.exists(app_file):
+ if not os.path.exists(vnf_file):
print("application.yml doesn't exit")
sys.exit(1)
@@ -57,9 +59,9 @@ if __name__ == "__main__":
print('format error in %s' % openo_file)
sys.exit(1)
- app_config = load_file(app_file)
- if not app_config:
- print('format error in %s' % app_file)
+ vnf_config = load_file(vnf_file)
+ if not vnf_config:
+ print('format error in %s' % vnf_file)
sys.exit(1)
opera_dir = os.getenv('OPERA_DIR')
@@ -69,4 +71,4 @@ if __name__ == "__main__":
sys.exit(1)
generate_openo_conf(openo_config, scripts_dir)
- generate_app_conf(openo_config, app_config, scripts_dir)
+ generate_app_conf(openo_config, vnf_config, scripts_dir)