Merge "Add error message when migrate from distributed router to centralized"

This commit is contained in:
Jenkins 2015-07-24 18:46:57 +00:00 committed by Gerrit Code Review
commit 7e16e052ca
3 changed files with 7 additions and 2 deletions

View File

@ -69,6 +69,10 @@ class ServiceUnavailable(NeutronException):
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")

View File

@ -87,7 +87,8 @@ class L3_NAT_with_dvr_db_mixin(l3_db.L3_NAT_db_mixin,
router_res.get('distributed') is False):
LOG.info(_LI("Centralizing distributed router %s "
"is not supported"), router_db['id'])
raise NotImplementedError()
raise n_exc.NotSupported(msg=_("Migration from distributed router "
"to centralized"))
elif (not router_db.extra_attributes.distributed and
router_res.get('distributed')):
# Notify advanced services of the imminent state transition

View File

@ -85,7 +85,7 @@ class L3DvrTestCase(testlib_api.SqlTestCase):
'distributed': True
}
router_db = self._create_router(router)
self.assertRaises(NotImplementedError,
self.assertRaises(exceptions.NotSupported,
self.mixin._validate_router_migration,
self.ctx, router_db, {'distributed': False})