palaniyappanBala / klish

Automatically exported from code.google.com/p/klish
Other
0 stars 0 forks source link

Variable inheritance from nested views #121

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Drop in attached XML in your CLISH_PATH
2. Then execute following commands:
  a. view1
  b. view2
  c. com2
3.

What is the expected output?
# view1 
(view-hello)# view2
(view2)# com2
Parent view-id hello

What do you see instead?
# view1 
(view-hello)# view2
(view2)# com2
Parent view-id 

Notice that there is no hello above.

What version of the product are you using?
1.6.1

On what operating system?
Linux

Please provide any additional information below.
I defined nested views, view1 and view2 (view1 is parent of view2). Also 
defined "depth" fields in VIEW XML tags. view2 is inheriting view1 commands. In 
this scenario, a command in view2 is not able to  expand a variable defined in 
view1.

Solution:
Looked at the code. Found that while a variable is being expanded, parent's 
view is not getting checked. Attaching a patch which fixes this issue.

Original issue reported on code.google.com by vdas...@gmail.com on 17 Sep 2012 at 7:53

Attachments:

GoogleCodeExporter commented 8 years ago
Hi

The attached nested-view.xml has a size 0.

Original comment by serj.kalichev@gmail.com on 18 Sep 2012 at 7:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Attaching nested-view.xml.

Original comment by vdas...@gmail.com on 18 Sep 2012 at 1:38

Attachments:

GoogleCodeExporter commented 8 years ago
It's not a bug. But probably the inheritance of upper viewid is good feature. 
I'll change it in future releases.

Original comment by serj.kalichev@gmail.com on 20 Sep 2012 at 5:22

GoogleCodeExporter commented 8 years ago
Serj,

I attached a patch for this. If you are ok with change, I can checkin code to 
the git as well.

Original comment by vdas...@gmail.com on 20 Sep 2012 at 2:40