-
Notifications
You must be signed in to change notification settings - Fork 68
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
ValueError: need more than 0 values to unpack #1
Comments
You need the libvirt-python package. |
I guess you mean python-libvirt, right? I had that installed already dpkg -s python-libvirt |
First error is because you didn't pass all the argument on the command-line (as libvirtd would) and the hook's code failed to validate that before unpacking. Second error is because it's trying to import the hook's code as a python module. |
Yeah, well, that makes sense now that you say it ;) linking qemu.py to qemu and starting test_qemu.py again finishes without any error, or any other message for that matter. I tried to lookup the arguments that qemu passes on and I thought this is what the arguments should look like, but that also fails. ./qemu debian7 prepare begin - Unfortunately the libvirt.log only states: My understanding was the exit code of the hook script != 0 wil result in error code 256 with the output of stderr, but there is no additional information that indicates what is wrong. Btw. this is how the qemu.json file looks: { hhttps://www.libvirt.org/hooks.html#structure |
You might be missing an extra "}" at the end. I usually like to run my json files through jq: cat file.son | jq '.' |
sigh Sorry that I wasted your time with this nonsense, of course I was missing an extra } at the end. Thanks for your help. Although the machine starts up and I can see the iptable rules, the port forwarding still isn't working, which is the same issue I had with the other solutions that you can find on the internet. Damn it... |
No worries! I got it to work here pretty much painlessly (for a change). My setup was using a single bridge, where I got the public IPs (actually, my lab's private IPs) and from there it would forward to the VM. It might be worth running tcpdump on the bridge interface and inside the guests to see what's arriving (and if the packets are mangled or not). |
[root@CentOS-71-64-minimal hooks]# virsh start Guest --console |
Just filed a PR that addresses the unit test part of this issue: https://github.com/saschpe/libvirt-hook-qemu/pull/6/files Yes, running the test script should produce output:
If not, the tests didn't run. @extr3mal it looks like you have an error in your JSON file (or did, 6 months ago...) |
#6 is in. @hillbicks, is there anything more that needs to be done to address this PR? |
Hey,
first of all, thanks for the script. Unfortunately though, it is not working for me. When starting the virtual machine it fails with error code 256. Starting the script from the shell results in the following error:
root@debiantest:/etc/libvirt/hooks# ./qemu
Traceback (most recent call last):
File "./qemu", line 96, in
vir_domain, action = sys.argv[1:3]
ValueError: need more than 0 values to unpack
This is on a debian wheezy machine with python 2.7.3.
oh, and test_qemu.py also fails:
root@debiantest:~/libvirt-hook-qemu-master# python test_qemu.py
Traceback (most recent call last):
File "test_qemu.py", line 5, in
import qemu # Our local libvirt hooks module
ImportError: No module named qemu
Could you give me a hint what is going on here?
Thanks!
The text was updated successfully, but these errors were encountered: