'Tests that there is no any sensitive info of image location
was logged in glance during the image update operation.'

@mock.patch.object(rserver.images.LOG, 'debug')
def test_update_image_not_log_sensitive_info(self, log_debug):

    def fake_log_debug(fmt_str, image_meta):
        self.assertNotIn("'locations'", (fmt_str % image_meta))
    fixture = {'name': 'fake    public    image    #2', 'min_disk': 5, 'min_ram': 256, 'disk_format': 'raw', 'location': 'fake://image'}
    body = jsonutils.dump_as_bytes(dict(image=fixture))
    log_debug.side_effect = fake_log_debug
    res = self.get_api_response_ext(http.OK, url=('/images/%s' % UUID2), body=body, method='PUT', content_type='json')
    res_dict = jsonutils.loads(res.body)
    self.assertNotEqual(res_dict['image']['created_at'], res_dict['image']['updated_at'])
    for (k, v) in six.iteritems(fixture):
        self.assertEqual(v, res_dict['image'][k])
