Updating a distributed router back to a legacy router
should return error 400 (BadRequest), not error 500.
Closes-Bug: #
1505346
Change-Id: Ia57e80107bd11ff7b38b89d30279603017913724
message = _("The service is unavailable")
-class NotSupported(NeutronException):
- message = _('Not supported: %(msg)s')
-
-
class AdminRequired(NotAuthorized):
message = _("User does not have admin privileges: %(reason)s")
router_res.get('distributed') is False):
LOG.info(_LI("Centralizing distributed router %s "
"is not supported"), router_db['id'])
- raise n_exc.NotSupported(msg=_("Migration from distributed router "
- "to centralized"))
+ raise n_exc.BadRequest(
+ resource='router',
+ msg=_("Migration from distributed router to centralized is "
+ "not supported"))
elif (not router_db.extra_attributes.distributed and
router_res.get('distributed')):
# router should be disabled in order for upgrade
'distributed': True
}
router_db = self._create_router(router)
- self.assertRaises(exceptions.NotSupported,
+ self.assertRaises(exceptions.BadRequest,
self.mixin._validate_router_migration,
self.ctx, router_db, {'distributed': False})