This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish should be operational if override config values were specified
- Loading branch information
Showing
7 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
server/pulp/server/db/migrations/0024_distributor_last_updated.py
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
server/pulp/server/db/migrations/0024_distributor_schema_change.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pulp.common import dateutils | ||
from pulp.server.db.connection import get_collection | ||
|
||
|
||
def migrate(*args, **kwargs): | ||
""" | ||
Add last_updated and last_override_config to the distributor collection. | ||
""" | ||
updated_key = 'last_updated' | ||
config_key = 'last_override_config' | ||
collection = get_collection('repo_distributors') | ||
for distributor in collection.find(): | ||
if config_key not in distributor.keys(): | ||
distributor[config_key] = {} | ||
|
||
if updated_key in distributor.keys(): | ||
continue | ||
elif 'last_publish' in distributor.keys(): | ||
distributor[updated_key] = distributor['last_publish'] | ||
else: | ||
distributor[updated_key] = dateutils.now_utc_datetime_with_tzinfo() | ||
|
||
collection.save(distributor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters