Project

Profile

Help

Task #989

Stop pulp from handing out uninitialized database connections

Added by bmbouter over 5 years ago. Updated over 1 year ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Currently if you make a call to get_database() or get_connection() without calling initialize() first, you would have None returned to you. Code that uses those will then fail in unexpected ways. This story is to add a behavior to get_database() and get_connection() such that if _DATABASE or _CONNECTION are None that an Exception is raised. This is similar to what is already implemented in get_collection.

Also, PulpCollectionFailure should be renamed to PulpDatabaseFailure so that it carries a name appropriate to be raised from all 3 of these functions. Each function that raises should use an error message appropriate for the function that was called.

These two steps were originally steps (3) and (5) from story #131.

Deliverables

1. Add behavior to get_database()
2. Add behavior to get_connection()
3. Rename PulpCollectionFailure to PulpDatabaseFailure
4. Add tests to assert the raise behaviors for get_collection(), get_database(), and get_connection()


Related issues

Related to Pulp - Refactor #131: Move pulp.server.db.connection.initialize() calls exclusively to entry pointsCLOSED - CURRENTRELEASE

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

History

#1 Updated by bmbouter over 5 years ago

  • Related to Refactor #131: Move pulp.server.db.connection.initialize() calls exclusively to entry points added

#2 Updated by bmbouter over 5 years ago

  • Description updated (diff)

#3 Updated by bmbouter over 1 year ago

  • Status changed from NEW to CLOSED - WONTFIX

#4 Updated by bmbouter over 1 year ago

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

#5 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF