Story #973 ยป distributor_config_added_to_publish_history.patch
server/pulp/server/db/model/repository.py | ||
---|---|---|
return r
|
||
@classmethod
|
||
def expected_result(cls, repo_id, distributor_id, distributor_type_id, started,
|
||
completed, summary, details, result_code):
|
||
def expected_result(cls, repo_id, distributor_id, distributor_type_id,
|
||
distributor_config, started, completed, summary,
|
||
details, result_code):
|
||
"""
|
||
Creates a new history entry for a successful publish.
|
||
... | ... | |
@type result_code: str
|
||
"""
|
||
r = cls(repo_id, distributor_id, distributor_type_id, started, completed, result_code)
|
||
r = cls(repo_id, distributor_id, distributor_type_id,
|
||
distributor_config, started, completed, result_code)
|
||
r.summary = summary
|
||
r.details = details
|
||
... | ... | |
return r
|
||
def __init__(self, repo_id, distributor_id, distributor_type_id, started, completed, result):
|
||
def __init__(self, repo_id, distributor_id, distributor_type_id,
|
||
distributor_config, started, completed, result):
|
||
"""
|
||
Describes the results of a single completed (potentially errored) publish.
|
||
Rather than directory instantiating instances, use one of the above
|
||
... | ... | |
self.repo_id = repo_id
|
||
self.distributor_id = distributor_id
|
||
self.distributor_type_id = distributor_type_id
|
||
self.distributor_config = distributor_config
|
||
self.started = started
|
||
self.completed = completed
|
||
self.result = result
|
server/pulp/server/managers/repo/publish.py | ||
---|---|---|
result_code = RepoPublishResult.RESULT_SUCCESS
|
||
result = RepoPublishResult.expected_result(
|
||
repo_id, repo_distributor['id'], repo_distributor['distributor_type_id'],
|
||
repo_id, repo_distributor['id'],
|
||
call_config.flatten(),
|
||
repo_distributor['distributor_type_id'], call_config.flatten(),
|
||
publish_start_timestamp, publish_end_timestamp, summary, details, result_code)
|
||
publish_result_coll.save(result, safe=True)
|
||
return result
|