Closed rico132 closed 2 months ago
Can you provide the code you used for device.config_file_save()
? It is pretty strange that it was looking for a path because the command is supposed to be used like device.config_file_save(file="/config/test300.config")
The problem is that something went wrong after your PR got merged. Maybe someone force pushed after the merge? I do not know, I am not great with git either. But to answer your question I am using it without any parameters like it is described in the readme: https://github.com/robertoberto/pyvyos/blob/main/README.md#configure-then-save
Because some of your code is missing in the release and main branch, the empty list check is also missing. Path is an empty list as default in the _get_payload function and path[0] will run into an IndexError without the empty list check.
@xTITUSMAXIMUSX
I think there will be no fast solution, so, if anyone has the same problem, the workaround is to install it like this:
pip install git+https://github.com/robertoberto/pyvyos.git@8ae0b4f237eb20d9ad9f511154df8eb554bde398
This is the merge commit before the code disappears from the main branch.
Unfortunately, this does not fix anything.
The code is still missing a check here.
You are accessing path even though it is an empty array. Therefore, I am still getting the error shown above.
I do not know what happened after 8ae0b4f237eb20d9ad9f511154df8eb554bde398, but the code does not contain the check anymore.
Hello @robertoberto, hello @xTITUSMAXIMUSX,
In the latest release (v0.2.1) and the main branch the function
produces an error:
In my opinion, this bug should be fixed with this PR https://github.com/robertoberto/pyvyos/pull/3 But it turns out the check for an empty list is missing in the main branch AND the latest release
Updating the pip package after you release a new version would also be nice.