Change-Id: Ie08f3029df03f97f1df1461a564c24ce024974fe
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
-OUTPUT=$(TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto)
-printf "$OUTPUT"
+echo "Launching tox"
+TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto
+
if len(parts) == 2:
kdu_model = parts[0]
if desc_params.get("kdu_atomic_upgrade"):
if len(parts) == 2:
kdu_model = parts[0]
if desc_params.get("kdu_atomic_upgrade"):
- atomic_upgrade = desc_params.get("kdu_atomic_upgrade").lower() in ("yes", "true", "1")
+ atomic_upgrade = desc_params.get(
+ "kdu_atomic_upgrade"
+ ).lower() in ("yes", "true", "1")
del desc_params["kdu_atomic_upgrade"]
else:
atomic_upgrade = True
del desc_params["kdu_atomic_upgrade"]
else:
atomic_upgrade = True
current_charm_artifact_path,
target_charm_artifact_path,
charm_artifact_paths,
current_charm_artifact_path,
target_charm_artifact_path,
charm_artifact_paths,
) = ([], [], [], [])
step = "Checking if revision has changed in VNFD"
) = ([], [], [], [])
step = "Checking if revision has changed in VNFD"
# add chart to list and all parameters
step = "Getting helm chart name"
chart_name = ee_item.get("helm-chart")
# add chart to list and all parameters
step = "Getting helm chart name"
chart_name = ee_item.get("helm-chart")
- if ee_item.get("helm-version") and ee_item.get("helm-version") == "v2":
+ if (
+ ee_item.get("helm-version")
+ and ee_item.get("helm-version") == "v2"
+ ):
vca_type = "helm"
else:
vca_type = "helm-v3"
step = "Setting Helm chart artifact paths"
vca_type = "helm"
else:
vca_type = "helm-v3"
step = "Setting Helm chart artifact paths"
- helm_artifacts.append({
- "current_artifact_path": get_charm_artifact_path(
- current_base_folder,
- chart_name,
- vca_type,
- current_vnf_revision,
- ),
- "target_artifact_path": get_charm_artifact_path(
- latest_base_folder,
- chart_name,
- vca_type,
- latest_vnfd_revision,
- ),
- "ee_id": ee_id,
- "vca_index": vca_index,
- "vdu_index": vdu_count_index,
- })
+ helm_artifacts.append(
+ {
+ "current_artifact_path": get_charm_artifact_path(
+ current_base_folder,
+ chart_name,
+ vca_type,
+ current_vnf_revision,
+ ),
+ "target_artifact_path": get_charm_artifact_path(
+ latest_base_folder,
+ chart_name,
+ vca_type,
+ latest_vnfd_revision,
+ ),
+ "ee_id": ee_id,
+ "vca_index": vca_index,
+ "vdu_index": vdu_count_index,
+ }
+ )
charm_artifact_paths = zip(
current_charm_artifact_path, target_charm_artifact_path
charm_artifact_paths = zip(
current_charm_artifact_path, target_charm_artifact_path
# helm base EE
for item in helm_artifacts:
# helm base EE
for item in helm_artifacts:
- if (
- not (
- item["current_artifact_path"]
- and item["target_artifact_path"]
- and self.check_charm_hash_changed(
- item["current_artifact_path"], item["target_artifact_path"]
- )
- )
+ if not (
+ item["current_artifact_path"]
+ and item["target_artifact_path"]
+ and self.check_charm_hash_changed(
+ item["current_artifact_path"],
+ item["target_artifact_path"],
+ )
- db_update_entry = "_admin.deployed.VCA.{}.".format(item["vca_index"])
+ db_update_entry = "_admin.deployed.VCA.{}.".format(
+ item["vca_index"]
+ )
vnfr_id = db_vnfr["_id"]
osm_config = {"osm": {"ns_id": nsr_id, "vnf_id": vnfr_id}}
db_dict = {
vnfr_id = db_vnfr["_id"]
osm_config = {"osm": {"ns_id": nsr_id, "vnf_id": vnfr_id}}
db_dict = {
"path": db_update_entry,
}
vca_type, namespace, helm_id = get_ee_id_parts(item["ee_id"])
"path": db_update_entry,
}
vca_type, namespace, helm_id = get_ee_id_parts(item["ee_id"])
- await self.vca_map[
- vca_type
- ].upgrade_execution_environment(
+ await self.vca_map[vca_type].upgrade_execution_environment(
namespace=namespace,
helm_id=helm_id,
db_dict=db_dict,
namespace=namespace,
helm_id=helm_id,
db_dict=db_dict,
self.logger.debug("get ssh key block")
rw_mgmt_ip = None
if deep_get(
self.logger.debug("get ssh key block")
rw_mgmt_ip = None
if deep_get(
- config_descriptor, ("config-access", "ssh-access", "required")
+ config_descriptor,
+ ("config-access", "ssh-access", "required"),
):
# Needed to inject a ssh key
user = deep_get(
config_descriptor,
("config-access", "ssh-access", "default-user"),
)
):
# Needed to inject a ssh key
user = deep_get(
config_descriptor,
("config-access", "ssh-access", "default-user"),
)
- step = "Install configuration Software, getting public ssh key"
- pub_key = await self.vca_map[vca_type].get_ee_ssh_public__key(
+ step = (
+ "Install configuration Software, getting public ssh key"
+ )
+ pub_key = await self.vca_map[
+ vca_type
+ ].get_ee_ssh_public__key(
ee_id=ee_id, db_dict=db_dict, vca_id=vca_id
)
ee_id=ee_id, db_dict=db_dict, vca_id=vca_id
)
- step = "Insert public key into VM user={} ssh_key={}".format(
- user, pub_key
+ step = (
+ "Insert public key into VM user={} ssh_key={}".format(
+ user, pub_key
+ )
)
self.logger.debug(logging_text + step)
)
self.logger.debug(logging_text + step)
"initial-config-primitive"
)
config_primitive = next(
"initial-config-primitive"
)
config_primitive = next(
- (p for p in initial_config_primitive_list if p["name"] == "config"),
+ (
+ p
+ for p in initial_config_primitive_list
+ if p["name"] == "config"
+ ),
None,
)
if not config_primitive:
None,
)
if not config_primitive:
deploy_params["rw_mgmt_ip"] = rw_mgmt_ip
if db_vnfr.get("additionalParamsForVnf"):
deploy_params.update(
deploy_params["rw_mgmt_ip"] = rw_mgmt_ip
if db_vnfr.get("additionalParamsForVnf"):
deploy_params.update(
- parse_yaml_strings(db_vnfr["additionalParamsForVnf"].copy())
+ parse_yaml_strings(
+ db_vnfr["additionalParamsForVnf"].copy()
+ )
)
primitive_params_ = self._map_primitive_params(
config_primitive, {}, deploy_params
)
primitive_params_ = self._map_primitive_params(
config_primitive, {}, deploy_params
self.db.get_one.return_value = {"_admin": {"helm-chart-v3": {"id": "myk8s_id"}}}
ee_id, _ = await self.helm_conn.create_execution_environment(
self.db.get_one.return_value = {"_admin": {"helm-chart-v3": {"id": "myk8s_id"}}}
ee_id, _ = await self.helm_conn.create_execution_environment(
- namespace, db_dict, artifact_path=artifact_path,
- chart_model=chart_model, vca_type="helm-v3"
+ namespace,
+ db_dict,
+ artifact_path=artifact_path,
+ chart_model=chart_model,
+ vca_type="helm-v3",
)
self.assertEqual(
ee_id,
)
self.assertEqual(
ee_id,
cffi==1.15.1
# via
# -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
cffi==1.15.1
# via
# -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# cryptography
# pynacl
charset-normalizer==2.1.1
# cryptography
# pynacl
charset-normalizer==2.1.1
# juju
# jujubundlelib
# kubernetes
# juju
# jujubundlelib
# kubernetes
# via
# -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# kubernetes
# via
# -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# kubernetes
# kubernetes
retrying-async==2.0.0
# via -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# kubernetes
retrying-async==2.0.0
# via -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# via
# -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# google-auth
# via
# -r https://osm.etsi.org/gitweb/?p=osm/N2VC.git;a=blob_plain;f=requirements.txt;hb=master
# google-auth
# via aiohttp
checksumdir==1.2.0
# via -r requirements.in
# via aiohttp
checksumdir==1.2.0
# via -r requirements.in
# via grpcio-tools
grpcio-tools==1.48.1
# via -r requirements.in
# via grpcio-tools
grpcio-tools==1.48.1
# via -r requirements.in
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
deps = -r{toxinidir}/requirements.txt
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
deps = -r{toxinidir}/requirements.txt
+parallel_show_output = true
#######################################################################################
[testenv:black]
#######################################################################################
[testenv:black]