Skip to content

Commit d315e01

Browse files
authored
fix vqfx custom version handling (#194)
1 parent a6338c0 commit d315e01

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

vqfx/docker/launch.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import datetime
44
import logging
55
import os
6+
import re
67
import signal
78
import sys
8-
import re
99

1010
import vrnetlab
1111

@@ -45,7 +45,10 @@ def __init__(self, hostname, username, password, conn_mode, version, disk_image)
4545
self.num_nics = 12
4646
self.conn_mode = conn_mode
4747
self.hostname = hostname
48-
self.version = version
48+
# _version is a custom version dict that has major and minor version components
49+
# while the self.version is a version @property of the common.VM class that reads
50+
# the value from the env var.
51+
self._version = version
4952

5053
def start(self):
5154
# use parent class start() function
@@ -93,7 +96,7 @@ def bootstrap_spin(self):
9396
# logged_in_prompt prompt for v20+ versions
9497
logged_in_prompt = b"root@:RE:0%"
9598

96-
if self.version["major"] < 20:
99+
if self._version["major"] < 20:
97100
logged_in_prompt = b"root@vqfx-re:RE:0%"
98101

99102
(ridx, match, res) = self.tn.expect([b"login:", logged_in_prompt], 1)
@@ -103,7 +106,7 @@ def bootstrap_spin(self):
103106
self.wait_write("root", wait=None)
104107

105108
# v19 has Juniper password for root login
106-
if self.version["major"] < 20:
109+
if self._version["major"] < 20:
107110
self.wait_write("Juniper", wait="Password:")
108111
if ridx == 1:
109112
# run main config!

0 commit comments

Comments
 (0)