default log location /var/log/paunch.log failes for non-root users

Bug #1803421 reported by Radoslaw Smigielski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
paunch
In Progress
Undecided
Radoslaw Smigielski

Bug Description

Paunch assumes default log location which is /var/log/paunch.log, if you run it as not root user every single commands fails with below error:

[radek][photon][±][master → origin U:2 ?:1 ✗][@venv.paunch][~/src/openstack/paunch]
$ paunch --debug list
[Errno 13] Permission denied: '/var/log/paunch.log'
Traceback (most recent call last):
  File "/home/radek/tmp/venv.paunch/lib/python2.7/site-packages/cliff/app.py", line 401, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/radek/tmp/venv.paunch/lib/python2.7/site-packages/cliff/display.py", line 116, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/radek/src/openstack/paunch/paunch/cmd.py", line 331, in take_action
    __name__, log_level, log_file)
  File "/home/radek/src/openstack/paunch/paunch/utils/common.py", line 35, in configure_logging
    fhandler = logging.FileHandler(log_file)
  File "/usr/lib64/python2.7/logging/__init__.py", line 920, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 950, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/paunch.log'
Traceback (most recent call last):
  File "/home/radek/tmp/venv.paunch/bin/paunch", line 10, in <module>
    sys.exit(main())
  File "/home/radek/src/openstack/paunch/paunch/main.py", line 40, in main
    return myapp.run(argv)
  File "/home/radek/tmp/venv.paunch/lib/python2.7/site-packages/cliff/app.py", line 281, in run
    result = self.run_subcommand(remainder)
  File "/home/radek/tmp/venv.paunch/lib/python2.7/site-packages/cliff/app.py", line 401, in run_subcommand
    result = cmd.run(parsed_args)
  File "/home/radek/tmp/venv.paunch/lib/python2.7/site-packages/cliff/display.py", line 116, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/radek/src/openstack/paunch/paunch/cmd.py", line 331, in take_action
    __name__, log_level, log_file)
  File "/home/radek/src/openstack/paunch/paunch/utils/common.py", line 35, in configure_logging
    fhandler = logging.FileHandler(log_file)
  File "/usr/lib64/python2.7/logging/__init__.py", line 920, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 950, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/paunch.log'

Changed in paunch:
assignee: nobody → Radoslaw Smigielski (radoslaw-smigielski)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/paunch 4.2.0

This issue was fixed in the openstack/paunch 4.2.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.