Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path checking problems for expert command, import and export in integration test #218

Closed
LJoyL opened this issue Aug 28, 2023 · 2 comments
Closed

Comments

@LJoyL
Copy link
Contributor

LJoyL commented Aug 28, 2023

Can't implement expert_command with path to module name with error "Couldn't find {prompted_path} in the tree" because the tree has not yet been populate by the others commands.

Looks like the path is being checked before the execution time of the command here : "@accept_path(argument=True)".

hot fix on my local nanorc :
replace @accept_path(argument=True) by @click.argument('node-path', type=str)

Move the node check and retrive it when sending the command.

# Check path validity when sending the command and not before for integtest compatibility
topnode = self.topnode
node = None
r = Resolver('name')
try:
    node = r.get(topnode, node_path)
except Exception as ex:
    raise click.BadParameter(f"Couldn't find {node_path} in the tree") from ex
@plasorak
Copy link
Contributor

Hi Leo, I think this is an acceptable solution, would you be able to create a PR with it? Thanks.

@plasorak
Copy link
Contributor

This has been merged and worked right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants