diff --git a/pillarsdk/resource.py b/pillarsdk/resource.py index 83d1ad2..39914c2 100644 --- a/pillarsdk/resource.py +++ b/pillarsdk/resource.py @@ -338,12 +338,8 @@ class Update(Resource): api = api or self.api attributes = attributes or self.to_dict() etag = attributes['_etag'] - attributes.pop('_id') - attributes.pop('_etag') - attributes.pop('_created') - attributes.pop('_updated') - attributes.pop('_links', None) - attributes.pop('_deleted', None) + + attributes = utils.remove_private_keys(attributes) attributes = utils.remove_none_attributes(attributes) url = utils.join_url(self.path, str(self['_id'])) headers = utils.merge_dict( @@ -369,12 +365,7 @@ class Replace(Resource): api = api or self.api attributes = attributes or self.to_dict() etag = attributes['_etag'] - attributes.pop('_id') - attributes.pop('_etag') - attributes.pop('_created') - attributes.pop('_updated') - attributes.pop('_links', None) - attributes.pop('_deleted', None) + attributes = utils.remove_private_keys(attributes) if 'parent' in attributes: attributes.pop('parent') url = utils.join_url(self.path, str(self['_id']))