Merge "Address nits in server group policy series"

This commit is contained in:
Zuul
2018-07-17 06:23:25 +00:00
committed by Gerrit Code Review
5 changed files with 8 additions and 8 deletions

View File

@@ -448,7 +448,7 @@ class InstanceGroup(API_BASE):
@property
def policy(self):
if len(self._policies) not in (0, 1):
if len(self._policies) > 1:
msg = ("More than one policy (%(policies)s) is associated with "
"group %(group_name)s, only the first one in the list "
"would be returned.")

View File

@@ -120,7 +120,7 @@ class _GroupAntiAffinityFilter(filters.BaseHostFilter):
{'group_uuid': group_uuid,
'host': host_state.host,
'max_server': max_server_per_host})
# Note(yikun): If the number of servers from same group on this host
# NOTE(yikun): If the number of servers from same group on this host
# is less than the max_server_per_host, this filter will accept the
# given host. In the default case(max_server_per_host=1), this filter
# will accept the given host if there are 0 servers from the group

View File

@@ -149,7 +149,7 @@ class TestGroupAffinityFilter(test.NoDBTestCase):
policy='affinity'))
self.assertTrue(filt_cls.host_passes(host, spec_obj))
spec_obj = objects.RequestSpec(instance_group=objects.InstanceGroup(
policy=policy, members=[], rules={}), instance_uuid=uuids.fake)
policy=policy, members=[]), instance_uuid=uuids.fake)
spec_obj.instance_group.hosts = []
self.assertTrue(filt_cls.host_passes(host, spec_obj))
spec_obj.instance_group.hosts = ['host2']

View File

@@ -1,9 +1,9 @@
---
features:
- |
Enable users to define the policy rules on server group policy to meet
more advanced policy requirement. This microversion 2.64 brings the
following changes in server group APIs:
Microversion 2.64 is added and enables users to define rules on server
group policy to meet more advanced policy requirements. This microversion
brings the following changes in server group APIs:
* Add ``policy`` and ``rules`` fields in the request of POST
``/os-server-groups``. The ``policy`` represents the name of policy. The