Skip to content

Commit 142d8ec

Browse files
authored
Revert "Update j2cli to jinjanator. (sonic-net#15600)" (sonic-net#15636)
This reverts commit 174c6bf.
1 parent 28f0f7a commit 142d8ec

4 files changed

+9
-15
lines changed

ansible/setup-management-network.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ echo "Refreshing apt package lists..."
3333
apt-get update
3434
echo
3535

36-
echo "STEP 1: Checking for jinjanator package..."
37-
if ! command -v jinjanate; then
38-
echo "jinjanator not found, installing jinjanator"
39-
cmd="install --user jinjanator==24.4.0"
36+
echo "STEP 1: Checking for j2cli package..."
37+
if ! command -v j2; then
38+
echo "j2cli not found, installing j2cli"
39+
cmd="install --user j2cli==0.3.10"
4040
if ! command -v pip &> /dev/null; then
4141
pip3 $cmd
4242
else

docs/testbed/README.testbed.Setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This document describes the steps to setup the testbed and deploy a topology.
2020
```
2121
- Install Python prerequisites
2222
```
23-
sudo pip3 install jinjanator
23+
sudo pip3 install j2cli
2424
```
2525
- Install Docker (all credits to https://docs.docker.com/engine/install/ubuntu/ )
2626
```

docs/testbed/README.testbed.VsSetup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ First, we need to prepare the host where we will be configuring the virtual test
2222
```
2323
sudo apt install python python-pip openssh-server
2424
# v0.3.10 Jinja2 is required, lower version may cause uncompatible issue
25-
sudo pip install jinjanate==24.4.0
25+
sudo pip install j2cli==0.3.10
2626
```
2727
2828
3. Run the host setup script to install required packages and initialize the management bridge network

setup-container.sh

+3-9
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ ROOT_PASS=${ROOT_PASS}
275275
EOF
276276

277277
log_info "generate a Dockerfile: ${TMP_DIR}/Dockerfile"
278-
jinjanate -o "${TMP_DIR}/Dockerfile" "${TMP_DIR}/Dockerfile.j2" "${TMP_DIR}/data.env" || \
278+
j2 -o "${TMP_DIR}/Dockerfile" "${TMP_DIR}/Dockerfile.j2" "${TMP_DIR}/data.env" || \
279279
log_error "failed to generate a Dockerfile: ${TMP_DIR}/Dockerfile"
280280

281281
log_info "building docker image from ${TMP_DIR}: ${LOCAL_IMAGE} ..."
@@ -445,14 +445,8 @@ if docker ps -a --format "{{.Names}}" | grep -q "^${CONTAINER_NAME}$"; then
445445
fi
446446
fi
447447

448-
if ! which jinjanate &> /dev/null; then
449-
echo "jinjanator not found, installing jinjanator"
450-
cmd="install --user jinjanator==24.4.0"
451-
if ! command -v pip &> /dev/null; then
452-
pip3 $cmd
453-
else
454-
pip $cmd
455-
fi
448+
if ! which j2 &> /dev/null; then
449+
exit_failure "missing Jinja2 templates support: make sure j2cli package is installed"
456450
fi
457451

458452
pull_sonic_mgmt_docker_image

0 commit comments

Comments
 (0)