Skip to content

Commit 1d2d922

Browse files
jeremylenzclaude
andcommitted
Ignore content_view_environment_id in HostGroup read()
This field is write-only — the API response does not include it, so read() must skip it to avoid a KeyError. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d3a83a6 commit 1d2d922

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

nailgun/entities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,6 +4118,7 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
41184118
ignore.add('root_pass')
41194119
ignore.add('kickstart_repository')
41204120
ignore.add('compute_resource')
4121+
ignore.add('content_view_environment_id')
41214122

41224123
attrs = attrs or self.read_json()
41234124
attrs['parent_id'] = attrs.pop('ancestry') # either an ID or None

tests/test_entities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3007,7 +3007,7 @@ def test_read(self):
30073007
)
30083008
self.assertSetEqual(
30093009
read.call_args[0][2], # ignore for EntityReadMixin.read call
3010-
{'compute_resource', 'kickstart_repository', 'root_pass'},
3010+
{'compute_resource', 'content_view_environment_id', 'kickstart_repository', 'root_pass'},
30113011
)
30123012
self.read_json_pacther.stop()
30133013
self.read_pacther.stop()

0 commit comments

Comments
 (0)