Commit ae70dd2a authored by kesnar's avatar kesnar
Browse files

refactor: change ztp naming for device component

parent 8f367f78
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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)
+3 −3
Original line number Diff line number Diff line
@@ -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
```