Project

Profile

Help

Issue #607

server/config.py reads server.conf when the module is loaded.

Added by jortel@redhat.com almost 6 years ago. Updated almost 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.5
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

server/config.py reads server.conf when the module is loaded.

+ This bug was cloned from Bugzilla Bug #1160369 +


Related issues

Related to Pulp - Issue #1409: config loading methods are calling in the wrong orderCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Pulp - Task #413: Our unit tests require read permissions on server.confCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 5b516218 View on GitHub
Added by semyers about 5 years ago

server.conf is lazily loaded

pulp.server.config would load /etc/pulp/server.conf unconditionally at import time. Converting this to lazily loading the config file allows for the config object to be instantiated without immediately trying to read the conf. This also allows changing the config files before loading them, which makes pulp.server.config testable.

fixes #607

Revision 5b516218 View on GitHub
Added by semyers about 5 years ago

server.conf is lazily loaded

pulp.server.config would load /etc/pulp/server.conf unconditionally at import time. Converting this to lazily loading the config file allows for the config object to be instantiated without immediately trying to read the conf. This also allows changing the config files before loading them, which makes pulp.server.config testable.

fixes #607

History

#1 Updated by bmbouter almost 6 years ago

  • Blocks Task #413: Our unit tests require read permissions on server.conf added

#2 Updated by bmbouter almost 6 years ago

  • Severity changed from Medium to 2. Medium

#3 Updated by rbarlow over 5 years ago

  • Priority changed from Normal to High

Since this one is related to #131, I propose that we raise the priority. Fixing the DB connecting will help, but ultimately the real problem is that Pulp performs side effects when modules are imported. This bug is just another manifestation of that problem, like #131.

#4 Updated by semyers about 5 years ago

  • Status changed from NEW to POST
  • Assignee set to semyers

I thought I'd assigned this to myself, but apparently not. :(

Apologies for going straight from NEW to POST, and here's the PR:
https://github.com/pulp/pulp/pull/2176

#5 Updated by semyers about 5 years ago

The referenced PR does technically fix the issue reported here, but in testing to see if this fix helps out #413, which is why this was made in the first place, new problems were revealed. I'm adding and adjusting tests to capture those failures, then fixing them.

#6 Updated by semyers about 5 years ago

  • Status changed from POST to ASSIGNED

I've reached the "but at what cost?" phase...

All core unit tests are passing with an unreadable server conf, but I'd like come back to it after a night's sleep and make sure my measures for making this possible are reasonable. I also need to write some docstrings, and then I'll get this all pushed up to the previously mentioned PR.

#7 Updated by semyers about 5 years ago

  • Status changed from ASSIGNED to POST

I did indeed find opportunities to clean things up a little bit and make some improvements. The PR has been updated with those changes.

#8 Updated by semyers about 5 years ago

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

#9 Updated by semyers about 5 years ago

  • Platform Release set to 2.8.0

#10 Updated by semyers about 5 years ago

  • Related to Issue #1409: config loading methods are calling in the wrong order added

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

  • Status changed from MODIFIED to 5

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

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#13 Updated by bmbouter almost 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF