clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
206 stars 69 forks source link

RFC: Partly fix handling of mountpoints in the 'up' command #519

Closed colinhusu closed 2 months ago

colinhusu commented 2 months ago

The up command right now does not properly handle mountpoints. Partly fix that.

Note that this does not yet fix the case where the current level is the top-level of the mounted module. In that case the up command should switch to the presence container that holds the mounted module. Instead it switches all the way up to the topmost level, so it has the same effect as the top command.

Fixing that would be more involved: co_up() on the top-level cg_obj of a mounted module returns NULL. That case would need to be handled by finding the cg_obj matching the mount-point container, i.e. the path stored in "cli-edit-mtpoint", and setting that as the new cligen_ph_workpoint. But I don't now how to get that cg_obj.

olofhagsand commented 2 months ago

I know,there is a lot of newautocli code in the controller, that needs to be retrofitted into more generic clixon code. But I never got edit modes to work, so the submission is appreciated.

colinhusu commented 2 months ago

Thanks for merging this!

But I never got edit modes to work, so the submission is appreciated.

Do you remember any specific problems in this area? For me edit mode basically appears to work in combination with mountpoints.

olofhagsand commented 2 months ago

Operation across mountpoints, such as "up"

olofhagsand commented 2 months ago

Do you remember any specific problems in this area? For me edit mode basically appears to work in combination with mountpoints.

Not really but there is an issue in the controller project: https://github.com/clicon/clixon-controller/issues/83

colinhusu commented 2 months ago

I don't remember having seen error messages similar to the one in the mentioned clixon-controller issue.

However, I did get some error-messages before due to inconsistent cli-edit-* states caused by earlier calls to up and top commands. But these should be addressed now.

olofhagsand commented 2 months ago

We will revisit that issue and see if it works now.