From 785799938d35aa27d095eec04e621ad1d6c3bd09 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 12 Dec 2019 15:09:55 +0530 Subject: [PATCH] old data passed in get should not be imposed on new get() call --- lib/jnpr/junos/factory/cmdtable.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/jnpr/junos/factory/cmdtable.py b/lib/jnpr/junos/factory/cmdtable.py index f5d38b943..59f063ca9 100644 --- a/lib/jnpr/junos/factory/cmdtable.py +++ b/lib/jnpr/junos/factory/cmdtable.py @@ -95,11 +95,12 @@ def get(self, *vargs, **kvargs): str) else \ kvargs['filters'] + cmd_args = self.CMD_ARGS.copy() if 'args' in kvargs and isinstance(kvargs['args'], dict): - self.CMD_ARGS.update(kvargs['args']) + cmd_args.update(kvargs['args']) - if len(self.CMD_ARGS) > 0: - self.GET_CMD = Template(self.GET_CMD).render(**self.CMD_ARGS) + if len(cmd_args) > 0: + self.GET_CMD = Template(self.GET_CMD).render(**cmd_args) # execute the Junos RPC to retrieve the table if hasattr(self, 'TARGET'):