From 0e25a61936414ce6d70fda6733a87f7db1640876 Mon Sep 17 00:00:00 2001 From: Matt Oswalt Date: Thu, 23 May 2019 22:11:40 -0700 Subject: [PATCH] Added directory lookup in config script Signed-off-by: Matt Oswalt --- lessons/tools/lesson-24-pyez/stage1/configs/vqfx.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lessons/tools/lesson-24-pyez/stage1/configs/vqfx.py b/lessons/tools/lesson-24-pyez/stage1/configs/vqfx.py index dd5d8765..568ff169 100644 --- a/lessons/tools/lesson-24-pyez/stage1/configs/vqfx.py +++ b/lessons/tools/lesson-24-pyez/stage1/configs/vqfx.py @@ -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()