diff --git a/nailgun/entities.py b/nailgun/entities.py index 91725926..0f3bb637 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -1491,7 +1491,7 @@ def create(self, create_missing=None): `_. """ - return DiscoveryRule( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -3047,7 +3047,7 @@ def create(self, create_missing=None): `_. """ - return Domain( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -3541,7 +3541,7 @@ def create(self, create_missing=None): `_. """ - return HostCollection( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -3621,7 +3621,7 @@ def create(self, create_missing=None): `_. """ - return HostGroup( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -4173,7 +4173,7 @@ def create(self, create_missing=None): For more information, see `Bugzilla #1449749 `_. """ - return Host( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -5230,7 +5230,7 @@ def create(self, create_missing=None): """ attrs = self.create_json(create_missing) - return Location(self._server_config, id=attrs['id']).read() + return type(self)(self._server_config, id=attrs['id']).read() def read(self, entity=None, attrs=None, ignore=None, params=None): """Work around a bug in the server's response. @@ -5307,7 +5307,7 @@ def create(self, create_missing=None): `_. """ - return Media( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -5572,7 +5572,7 @@ def create(self, create_missing=None): `_. """ - return Organization( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -6433,7 +6433,7 @@ def create(self, create_missing=None): `_. """ - return Realm( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -8013,7 +8013,7 @@ def create(self, create_missing=None): `_. """ - return TailoringFile( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -8184,7 +8184,7 @@ def create(self, create_missing=None): `_. """ - return UserGroup( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -8461,7 +8461,7 @@ def create(self, create_missing=None): `_. """ - return ScapContents( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read() @@ -8580,7 +8580,7 @@ def create(self, create_missing=None): """ self._fields['event'] = entity_fields.StringField(required=True, choices=self.get_events()) - return Webhooks( + return type(self)( self._server_config, id=self.create_json(create_missing)['id'], ).read()