Project

Profile

Help

Issue #1278

no error if content source conf file is not readable

Added by cduryee about 5 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.7.0 Beta
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

I inadvertently created a conf file in /etc/pulp/content/sources/conf.d with permissions of 600 instead of 644. When I ran 'pulp-admin content sources list', it simply showed that there were no content sources instead of returning an error. This caused a couple of hours of debugging on my part to find my mistake.

Ideally, the load_all() function in model.py will throw an exception if it tries to read a conf file that is not readable.

Associated revisions

Revision 02bdb173 View on GitHub
Added by mhrivnak about 5 years ago

log a warning when a content source config file cannot be read

fixes #1278

Revision 02bdb173 View on GitHub
Added by mhrivnak about 5 years ago

log a warning when a content source config file cannot be read

fixes #1278

History

#1 Updated by mhrivnak about 5 years ago

  • Severity changed from 2. Medium to 3. High
  • Platform Release set to 2.8.0
  • Triaged changed from No to Yes

#2 Updated by jortel@redhat.com about 5 years ago

This appears to be a bug in ConfigParser.read(). As a workaround, I suggest adding:

if not os.access(path, os.R_OK):
    <log something>
    continue

immediately following the check to see if it is a file.

If confirmed that this is in ConfigParser, let's file a bug on it upstream.

#3 Updated by mhrivnak about 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mhrivnak

#4 Updated by mhrivnak about 5 years ago

ConfigParser has unconventional behavior; we have not discovered a bug in it. The read() function returns a list of files that were successfully read, and we were ignoring that list. There is a reasonable explanation detailed here: https://docs.python.org/2/library/configparser.html#ConfigParser.RawConfigParser.read

#5 Updated by mhrivnak about 5 years ago

  • Status changed from ASSIGNED to POST

#6 Updated by mhrivnak about 5 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#7 Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from MODIFIED to 5

#8 Updated by dkliban@redhat.com over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#9 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF