Move models for restrictions to cluster object

Since there are a couple of places where models for
restrictions is initialized, it's moved to cluster object.
Also, comments from previous commit
(Ibba7951968cbafd59fff0d516e74f9dd9e454edc) are fixed

It's refactoring bug is not needed.

Change-Id: Ic499a5deefb12740ebedc630b024dae0b4248ec5
This commit is contained in:
Artur Svechnikov 2016-05-11 12:43:23 +03:00 committed by Nikita Zubkov
parent 93d7fb982b
commit 963272a0d5
1 changed files with 6 additions and 2 deletions

View File

@ -187,10 +187,14 @@ class TestNodeReassignNoReinstallValidator(tests_base.BaseCloneClusterTest):
"reprovision": False,
"roles": ['controller', 'compute'],
})
msg = "^Role 'controller' in conflict with role 'compute'.$"
with self.assertRaisesRegexp(errors.InvalidData, msg):
with self.assertRaises(errors.InvalidData) as exc:
self.validator.validate(data, self.dst_cluster)
self.assertEqual(
exc.exception.message,
"Role 'controller' in conflict with role 'compute'."
)
class TestCopyVIPsValidator(base.BaseTestCase):
validator = validators.CopyVIPsValidator