我正在开发一个零日配置工具,我正在尝试将配置部署到EX2200交换机。我正在使用PyEZ框架连接到设备:
dev = Device(mode='serial', port='/dev/ttyUSB0',user="user",
password="password", gather_facts=True)
dev.open()
对象dev应该是类Device的一个实例,但是当我用dev._ class _检查它的类时,它表示类'jnpr.junos.console.Console'。 我想通过jinja2模板传递dev配置,
cu = Config(dev)
rsp=cu.load(template_path=template_path,
template_vars=config_data,merge=True)
但加载配置时出现以下错误:
Error loading config: 'Console' object has no attribute '_j2ldr'
非常感谢任何帮助。谢谢!