lxc / python3-lxc

Python 3.x binding for liblxc
https://linuxcontainers.org/lxc
GNU Lesser General Public License v2.1
57 stars 38 forks source link

Fixes incorrect behavior with create() after destroy() #23

Closed anirudh-goyal closed 3 years ago

anirudh-goyal commented 3 years ago

[Work in progress PR]

Fixes #16

the issue here is that create() creates a rootfs for a container while destroy() deletes the container itself including its path. It's that step which is preventing it be re-created as the object still has its old config, causing it to prevent a new create() run.

Changes:

Signed-off-by: Anirudh Goyal anirudhgoyal@utexas.edu

stgraber commented 3 years ago

Looks good, can you rebase the branch into a single commit and make sure you have a blank line between title and Signed-off-by (Github gets a bit confused otherwise :))!

anirudh-goyal commented 3 years ago

Done, thank you!

Btw, for some reason, my python3-lxc just keeps returning False every time I try to create a container, even with the busybox template. I tried poking around but couldn't figure out the root cause. As a result, I haven't been able to test this fix.

stgraber commented 3 years ago

@anirudh-goyal are you running it as root?

stgraber commented 3 years ago

Looks good to me and seems to work here. Thanks!