summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Vu-Brugier <cvubrugier@yahoo.fr>2014-07-01 20:22:34 +0200
committerChristophe Vu-Brugier <cvubrugier@yahoo.fr>2014-07-01 20:22:51 +0200
commit0c078e8927a9b645e5686c5f1ea30aaf2d9be6cb (patch)
treef5a41f64c2b8d5f2f1e8bb67f760523affdced87
parentd34f7c2f9b600f78485f0c14429d20e63380b4b5 (diff)
downloadconfigshell-fb-0c078e8927a9b645e5686c5f1ea30aaf2d9be6cb.tar.gz
Fix ui_command_get() when no parameter is provided
The "get attribute" command displays an error message after the list of attributes. For instance, in the TPG context, the following error is displayed: No parameter 't' in group 'attribute' This happens because the 'parameter' argument in ui_command_get() is overwritten in the loop that iterates over the list of parameters to display their value. This patch fixes the issue by renaming the variable in the loop so that the value of the original 'parameter' variable is preserved. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
-rw-r--r--configshell/node.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/configshell/node.py b/configshell/node.py
index bf5d534..27272d1 100644
--- a/configshell/node.py
+++ b/configshell/node.py
@@ -607,12 +607,12 @@ class ConfigNode(object):
value = group_getter(p_def['name'])
type_method = self.get_type_method(p_def['type'])
value = type_method(value, reverse=True)
- parameter = "%s=%s" % (p_def['name'], value)
+ param = "%s=%s" % (p_def['name'], value)
if p_def['writable'] is False:
- parameter += " [ro]"
- underline2 = ''.ljust(len(parameter), '-')
+ param += " [ro]"
+ underline2 = ''.ljust(len(param), '-')
parameters += '%s\n%s\n%s\n\n' \
- % (parameter, underline2, p_def['description'])
+ % (param, underline2, p_def['description'])
self.shell.con.epy_write('''%s\n%s\n%s\n'''
% (section, underline1, parameters))