Skip to content

Commit

Permalink
[cherry-pick 6.8.z] traces status ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
tstrych committed Nov 2, 2020
1 parent 24b389a commit e41bb00
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4260,6 +4260,9 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
`content_facet_attributes` are returned only in case any of facet
attributes were actually set.
`traces_status` and `traces_status_label` are returned only in case when
katello-host-tools-tracer is installed on the host
Also add image to the response if needed, as
:meth:`nailgun.entity_mixins.EntityReadMixin.read` can't initialize
image.
Expand All @@ -4274,6 +4277,9 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
ignore.add('host_parameters_attributes')
if 'content_facet_attributes' not in attrs:
ignore.add('content_facet_attributes')
if 'traces_status' not in attrs and 'traces_status_label' not in attrs:
ignore.add('traces_status')
ignore.add('traces_status_label')
ignore.add('compute_attributes')
ignore.add('interfaces_attributes')
ignore.add('root_pass')
Expand Down Expand Up @@ -4307,10 +4313,6 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
]
if 'build_status_label' in attrs:
result.build_status_label = attrs['build_status_label']
if 'content_facet_attributes' in attrs and \
not attrs['content_facet_attributes']['katello_tracer_installed']:
ignore.add('traces_status')
ignore.add('traces_status_label')
return result

def update(self, fields=None):
Expand Down

0 comments on commit e41bb00

Please sign in to comment.