except exception.VolumeNotFound as error:
raise webob.exc.HTTPNotFound(explanation=error.msg)
- readonly_flag = body['os-update_readonly_flag'].get('readonly')
- if not readonly_flag:
+ try:
+ readonly_flag = body['os-update_readonly_flag']['readonly']
+ except KeyError:
msg = _("Must specify readonly in request.")
raise webob.exc.HTTPBadRequest(explanation=msg)
self.assertEqual(res.status_int, return_code)
make_update_readonly_flag_test(self, True, 202)
+ make_update_readonly_flag_test(self, False, 202)
+ make_update_readonly_flag_test(self, '1', 202)
make_update_readonly_flag_test(self, '0', 202)
make_update_readonly_flag_test(self, 'true', 202)
make_update_readonly_flag_test(self, 'false', 202)