Skip to content
Snippets Groups Projects
Commit ae70dd2a authored by famelis's avatar famelis
Browse files

refactor: change ztp naming for device component

parent 8f367f78
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!166Refactor/47 ubi rename ztp component
......@@ -123,13 +123,13 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
t9 = time.time()
automation_service_host = get_env_var_name(ServiceNameEnum.AUTOMATION, ENVVAR_SUFIX_SERVICE_HOST)
ztp_service_host = get_env_var_name(ServiceNameEnum.ZTP, ENVVAR_SUFIX_SERVICE_HOST)
environment_variables = set(os.environ.keys())
if automation_service_host in environment_variables:
# Automation component is deployed; leave devices disabled. Automation will enable them.
if ztp_service_host in environment_variables:
# ZTP component is deployed; leave devices disabled. ZTP will enable them.
device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED
else:
# Automation is not deployed; assume the device is ready while onboarding and set them as enabled.
# ZTP is not deployed; assume the device is ready while onboarding and set them as enabled.
device.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED
device_id = context_client.SetDevice(device)
......
......@@ -52,7 +52,7 @@ Script requires more variables than before as of February 2023.
# See https://labs.etsi.org/rep/tfs/controller/-/blob/develop/my_deploy.sh
# Use docker run -d -p 32000:5000 --restart=always --name registry registry:2
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator"
export TFS_COMPONENTS="context device ztp monitoring pathcomp service slice compute webui load_generator"
export TFS_IMAGE_TAG="dev"
export TFS_K8S_NAMESPACE="tfs"
export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"
......@@ -113,14 +113,14 @@ Run deploy script to build in docker containers and then instantiate to configur
If protobuf definitions have changed, regenerate version controlled Java files manually
(it is a horrifying bug in build system that this is not automated!).
```
cd automation
cd ztp
# In case Java is not already installed
sudo apt-get install openjdk-11-jdk -y
export MAVEN_OPTS='--add-exports=java.base/jdk.internal.module=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED'
cd src/policy
./mvnw compile
cd -
cd src/automation
cd src/ztp
./mvnw compile
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment