summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Valo <kvalo@adurom.com>2015-10-25 14:23:07 +0200
committerLars Wirzenius <liw@liw.fi>2015-10-25 14:25:07 +0200
commit7c284793b342211f6320d60ef8a2e5a8e34345b2 (patch)
tree637ef3a36a6579358bb429437ee1609fbe9f4d23
parent220c63472a14cc2d55c7c48b03ed119737dc873a (diff)
downloadobnam-7c284793b342211f6320d60ef8a2e5a8e34345b2.tar.gz
setup.py: fix get_wanted_formats() not to use global configuration file
When I tried to run unit tests it failed because of permission access: $ ./check run unit tests Running test 650/650: test_updates_subdirectory_of_persistent_directory OK 436 excluded statements 42 excluded modules Time: 2.6 s ERROR:root:Command failed: ./obnam list-formats CRITICAL:root:Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/cliapp/app.py", line 182, in _run self.setup_logging() File "/usr/lib/python2.7/dist-packages/cliapp/app.py", line 408, in setup_logging delay=False) File "/usr/lib/python2.7/dist-packages/cliapp/app.py", line 58, in __init__ *args, **kwargs) File "/usr/lib/python2.7/logging/handlers.py", line 118, in __init__ BaseRotatingHandler.__init__(self, filename, mode, encoding, delay) File "/usr/lib/python2.7/logging/handlers.py", line 65, in __init__ logging.FileHandler.__init__(self, filename, mode, encoding, delay) File "/usr/lib/python2.7/logging/__init__.py", line 897, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib/python2.7/dist-packages/cliapp/app.py", line 65, in _open return logging.handlers.RotatingFileHandler._open(self) File "/usr/lib/python2.7/logging/__init__.py", line 916, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 13] Permission denied: '/var/tmp/obnam.log' This was because my global configuration had a log file configured and it was not accessible to a normal user: $ grep '^log:' /etc/obnam.conf log: /var/tmp/obnam.log $ ls -l /var/tmp/obnam.log -rw------- 1 root root 24112886 Oct 25 08:58 /var/tmp/obnam.log $
-rwxr-xr-xsetup.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 7d5768d1..b488ecf8 100755
--- a/setup.py
+++ b/setup.py
@@ -206,7 +206,8 @@ class Check(Command):
if 'REPOSITORY_FORMAT' in os.environ:
return [os.environ['REPOSITORY_FORMAT']]
else:
- return cliapp.runcmd(['./obnam', 'list-formats']).splitlines()
+ return cliapp.runcmd(['./obnam', '--no-default-configs',
+ 'list-formats']).splitlines()
def run_yarn_for_repo_format(self, repo_format):
print 'run yarn for repository format %s' % repo_format