Skip to content

Commit

Permalink
Revert "Revert "Refs #RHINENG-2640 - set reporter to "discovery" or "…
Browse files Browse the repository at this point in the history
…satellite" (#71)" (#75)" (#78)

This reverts commit ab64ae1.
  • Loading branch information
JoySnow authored May 20, 2024
1 parent 77f3398 commit a905dc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/modifiers/test_add_host_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_add_host_facts():
'report_platform_id': '123', 'source': 'satellite', 'request_id': uuid1}
AddHostFacts().run(host, transformed_obj, request_obj=request_obj)
assert host['facts'][0]['namespace'] == 'yupana'
assert host['reporter'] == 'satellite'
assert 'facts' in transformed_obj['modified']


Expand Down
2 changes: 1 addition & 1 deletion yuptoo/modifiers/add_host_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run(self, host: dict, transformed_obj: dict, **kwargs):
yuptoo_facts['facts']['account'] = request_obj['account']
host_facts.append(yuptoo_facts)
host['stale_timestamp'] = self.get_stale_time(request_obj)
host['reporter'] = 'yupana'
host['reporter'] = 'discovery' if request_obj['source'] == "discovery" else 'satellite'
host['facts'] = host_facts
if cert_cn and ('system_profile' in host):
host['system_profile']['owner_id'] = cert_cn
Expand Down

0 comments on commit a905dc9

Please sign in to comment.