Merge "Use openstack-images-v2.1-json-patch for update method"
This commit is contained in:
		@@ -157,7 +157,7 @@ class Controller(object):
 | 
				
			|||||||
                delattr(image, key)
 | 
					                delattr(image, key)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        url = '/v2/images/%s' % image_id
 | 
					        url = '/v2/images/%s' % image_id
 | 
				
			||||||
        hdrs = {'Content-Type': 'application/openstack-images-v2.0-json-patch'}
 | 
					        hdrs = {'Content-Type': 'application/openstack-images-v2.1-json-patch'}
 | 
				
			||||||
        self.http_client.raw_request('PATCH', url,
 | 
					        self.http_client.raw_request('PATCH', url,
 | 
				
			||||||
                                     headers=hdrs,
 | 
					                                     headers=hdrs,
 | 
				
			||||||
                                     body=image.patch)
 | 
					                                     body=image.patch)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -514,7 +514,7 @@ class TestController(testtools.TestCase):
 | 
				
			|||||||
        params = {'name': 'pong'}
 | 
					        params = {'name': 'pong'}
 | 
				
			||||||
        image = self.controller.update(image_id, **params)
 | 
					        image = self.controller.update(image_id, **params)
 | 
				
			||||||
        expect_hdrs = {
 | 
					        expect_hdrs = {
 | 
				
			||||||
            'Content-Type': 'application/openstack-images-v2.0-json-patch',
 | 
					            'Content-Type': 'application/openstack-images-v2.1-json-patch',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        expect_body = '[{"path": "/name", "value": "pong", "op": "replace"}]'
 | 
					        expect_body = '[{"path": "/name", "value": "pong", "op": "replace"}]'
 | 
				
			||||||
        expect = [
 | 
					        expect = [
 | 
				
			||||||
@@ -533,7 +533,7 @@ class TestController(testtools.TestCase):
 | 
				
			|||||||
        params = {'finn': 'human'}
 | 
					        params = {'finn': 'human'}
 | 
				
			||||||
        image = self.controller.update(image_id, **params)
 | 
					        image = self.controller.update(image_id, **params)
 | 
				
			||||||
        expect_hdrs = {
 | 
					        expect_hdrs = {
 | 
				
			||||||
            'Content-Type': 'application/openstack-images-v2.0-json-patch',
 | 
					            'Content-Type': 'application/openstack-images-v2.1-json-patch',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        expect_body = '[{"path": "/finn", "value": "human", "op": "add"}]'
 | 
					        expect_body = '[{"path": "/finn", "value": "human", "op": "add"}]'
 | 
				
			||||||
        expect = [
 | 
					        expect = [
 | 
				
			||||||
@@ -552,7 +552,7 @@ class TestController(testtools.TestCase):
 | 
				
			|||||||
        remove_props = ['barney']
 | 
					        remove_props = ['barney']
 | 
				
			||||||
        image = self.controller.update(image_id, remove_props)
 | 
					        image = self.controller.update(image_id, remove_props)
 | 
				
			||||||
        expect_hdrs = {
 | 
					        expect_hdrs = {
 | 
				
			||||||
            'Content-Type': 'application/openstack-images-v2.0-json-patch',
 | 
					            'Content-Type': 'application/openstack-images-v2.1-json-patch',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        expect_body = '[{"path": "/barney", "op": "remove"}]'
 | 
					        expect_body = '[{"path": "/barney", "op": "remove"}]'
 | 
				
			||||||
        expect = [
 | 
					        expect = [
 | 
				
			||||||
@@ -573,7 +573,7 @@ class TestController(testtools.TestCase):
 | 
				
			|||||||
        remove_props = ['barney']
 | 
					        remove_props = ['barney']
 | 
				
			||||||
        image = self.controller.update(image_id, remove_props, **params)
 | 
					        image = self.controller.update(image_id, remove_props, **params)
 | 
				
			||||||
        expect_hdrs = {
 | 
					        expect_hdrs = {
 | 
				
			||||||
            'Content-Type': 'application/openstack-images-v2.0-json-patch',
 | 
					            'Content-Type': 'application/openstack-images-v2.1-json-patch',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        expect_body = '[{"path": "/barney", "value": "miller", ' \
 | 
					        expect_body = '[{"path": "/barney", "value": "miller", ' \
 | 
				
			||||||
                      '"op": "replace"}]'
 | 
					                      '"op": "replace"}]'
 | 
				
			||||||
@@ -595,7 +595,7 @@ class TestController(testtools.TestCase):
 | 
				
			|||||||
        remove_props = ['finn']
 | 
					        remove_props = ['finn']
 | 
				
			||||||
        image = self.controller.update(image_id, remove_props, **params)
 | 
					        image = self.controller.update(image_id, remove_props, **params)
 | 
				
			||||||
        expect_hdrs = {
 | 
					        expect_hdrs = {
 | 
				
			||||||
            'Content-Type': 'application/openstack-images-v2.0-json-patch',
 | 
					            'Content-Type': 'application/openstack-images-v2.1-json-patch',
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        expect_body = '[{"path": "/finn", "value": "human", "op": "add"}]'
 | 
					        expect_body = '[{"path": "/finn", "value": "human", "op": "add"}]'
 | 
				
			||||||
        expect = [
 | 
					        expect = [
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user