We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I noticed that the method recursive_get doesn't seem to preserve permissions. On the contrary, lxc file pull appears to preserve permission.
recursive_get
lxc file pull
To reproduce: test.py:
#!/usr/bin/python3 from pylxd import Client lxd_client = Client() config = { 'name': 'helloworld', 'source': { 'type': 'image', 'protocol': 'simplestreams', 'server': 'https://images.linuxcontainers.org', 'alias': 'ubuntu/jammy/cloud/amd64', }, } instance = lxd_client.instances.create(config, wait=True) instance.start(wait=True) instance.execute(['touch', '/hello-world']) instance.execute(['chmod', '+x', '/hello-world']) instance.files.recursive_get('/hello-world', 'hello-world')
then run:
$ python3 test.py $ ls -l hello-world -rw-rw-r-- 1 guillaume guillaume 0 juin 30 17:24 hello-world $ lxc file pull --recursive helloworld/hello-world hello-world-2 $ ls -l hello-world-2 -rwxr-xr-x 1 guillaume guillaume 0 juin 30 17:25 hello-world-2
We can see that the lxc file pull kept the execution permission while the recursive_get didn't
pylxd version: 2.3.2a0 lxc version: 5.15
The text was updated successfully, but these errors were encountered:
I solved it in my project by reimplementing recursive_get: https://github.com/canonical/colcon-in-container/blob/main/colcon_in_container/providers/lxd.py#L110:L129
Sorry, something went wrong.
No branches or pull requests
I noticed that the method
recursive_get
doesn't seem to preserve permissions.On the contrary,
lxc file pull
appears to preserve permission.To reproduce:
test.py:
then run:
We can see that the
lxc file pull
kept the execution permission while the recursive_get didn'tpylxd version: 2.3.2a0
lxc version: 5.15
The text was updated successfully, but these errors were encountered: