Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

requires root privileges and touches /var during build #963

Closed
cgwalters opened this issue Apr 3, 2017 · 2 comments
Closed

requires root privileges and touches /var during build #963

cgwalters opened this issue Apr 3, 2017 · 2 comments
Assignees

Comments

@cgwalters
Copy link
Member

https://ci.centos.org/view/Atomic/job/fahc-rdgo/1443/artifact/build-logs/failed/atomic/build.log

+ make PYTHON=/usr/bin/python3 PYLINT=true all
/usr/bin/python3 setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import Atomic as _Atomic
  File "/builddir/build/BUILD/atomic-v1.16.3-52-f88187d5e42c496b4ed7a2ffc3a891847def925d/Atomic/__init__.py", line 1, in <module>
    from .pulp import PulpServer, PulpConfig
  File "/builddir/build/BUILD/atomic-v1.16.3-52-f88187d5e42c496b4ed7a2ffc3a891847def925d/Atomic/pulp.py", line 10, in <module>
    from . import util
  File "/builddir/build/BUILD/atomic-v1.16.3-52-f88187d5e42c496b4ed7a2ffc3a891847def925d/Atomic/util.py", line 37, in <module>
    os.makedirs(ATOMIC_VAR_LIB)
  File "/usr/lib64/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/lib/atomic'
@jlebon
Copy link
Contributor

jlebon commented Apr 6, 2017

@baude Basically, the mkdir shouldn't be triggered by importing the module. E.g. you can simply move it to create when needed.

@baude
Copy link
Member

baude commented Apr 6, 2017

PTAL #966

cgwalters pushed a commit to baude/atomic that referenced this issue Apr 12, 2017
We shouldn't do anything at module import time, as that happens during builds,
where we don't want to touch the host system (and may not have privileges to do
so).

This required some refactoring of the locking code too, as simply
instantiating the decorator was creating files too.

Closes: projectatomic#963
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants