Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.terraform.lock.hcl
terraform.tfstate*
.terraform.tfstate.lock.info
.idea/
22 changes: 18 additions & 4 deletions modules/deploy/data/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from time import sleep

import virl2_client as pcl

from virl2_client.virl2_client import Version

def set_license() -> str:
nodes = os.getenv("CFG_LICENSE_NODES") or 0
Expand All @@ -23,9 +23,23 @@ def set_license() -> str:
return ""

regid = "regid.2019-10.com.cisco.CML_NODE_COUNT,1.0_2607650b-6ca8-46d5-81e5-e6688b7383c4"
client = pcl.ClientLibrary(
"localhost", username=admin_user, password=admin_pass, ssl_verify=False
)

version = getattr(pcl.ClientLibrary, "VERSION", None)
if version is not None and version >= Version("2.9.0"):
client = pcl.ClientLibrary(
"localhost",
username=admin_user,
password=admin_pass,
ssl_verify=False,
client_type="CloudCml"
)
else:
client = pcl.ClientLibrary(
"localhost",
username=admin_user,
password=admin_pass,
ssl_verify=False,
)

try:
client.licensing.deregister()
Expand Down