Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
Added directory lookup in config script
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Oswalt <[email protected]>
  • Loading branch information
Mierdin committed May 24, 2019
1 parent c7b51a6 commit 0e25a61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lessons/tools/lesson-24-pyez/stage1/configs/vqfx.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
address_cidr = "%s/%s" % (addr, prefix['prefix_length'])

# Create template configuration with this address
loader = FileSystemLoader(["./"])
loader = FileSystemLoader([os.path.dirname(os.path.realpath(__file__))]) # Use current directory
env = Environment(loader=loader, trim_blocks=True, lstrip_blocks=True)
template_object = env.get_template(template_file)
rendered_config = template_object.render(mgmt_addr=address_cidr)

# Push rendered config to device
device.load_replace_candidate(config=rendered_config)
device.load
device.commit_config()

0 comments on commit 0e25a61

Please sign in to comment.