Skip to content

Commit

Permalink
Merge pull request #1084 from rahkumar651991/crpd_model
Browse files Browse the repository at this point in the history
cRPD model check to be added for on-box junos
  • Loading branch information
Nitin Kr committed Oct 13, 2020
2 parents ab0e860 + cf58712 commit b009613
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/jnpr/junos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,26 @@ class _Connection(object):
or platform.release().startswith("JNPR")
or os.path.isfile("/usr/share/cevo/cevo_version")
)

# for juniper specific containers likes crpd, cmgd, cbng
# and similar entities, we will need to check the product.conf
# file for on-box implementation

if ON_JUNOS is False:
if os.path.isfile("/etc/product.conf") is True:
model_dict = {}
with open("/etc/product.conf") as f:
for line in f:
(key, val) = line.strip().split("=")
model_dict[key] = val

if "model" in model_dict and model_dict["model"] in [
"crpd",
"cbng",
"cmgd",
]:
ON_JUNOS = True

auto_probe = 0 # default is no auto-probe

# ------------------------------------------------------------------------
Expand Down

0 comments on commit b009613

Please sign in to comment.