summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--novaclient/tests/unit/v2/test_shell.py4
-rw-r--r--novaclient/v2/shell.py3
-rw-r--r--releasenotes/notes/bug-1767287-cc28d60d9e59f9bd.yaml6
3 files changed, 11 insertions, 2 deletions
diff --git a/novaclient/tests/unit/v2/test_shell.py b/novaclient/tests/unit/v2/test_shell.py
index 66300c89..504eb39d 100644
--- a/novaclient/tests/unit/v2/test_shell.py
+++ b/novaclient/tests/unit/v2/test_shell.py
@@ -3571,6 +3571,10 @@ class ShellTest(utils.TestCase):
{'server_group': {'name': 'wjsg',
'policies': ['affinity']}})
+ def test_create_server_group_with_multiple_policies(self):
+ self.assertRaises(SystemExit, self.run_command,
+ 'server-group-create wjsg affinity anti-affinity')
+
def test_delete_multi_server_groups(self):
self.run_command('server-group-delete 12345 56789')
self.assert_called('DELETE', '/os-server-groups/56789')
diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py
index d53fc05b..e4c826b6 100644
--- a/novaclient/v2/shell.py
+++ b/novaclient/v2/shell.py
@@ -4501,8 +4501,7 @@ def do_server_group_list(cs, args):
@utils.arg(
'policy',
metavar='<policy>',
- nargs='+',
- help=_('Policies for the server groups.'))
+ help=_('Policy for the server group.'))
def do_server_group_create(cs, args):
"""Create a new server group with the specified details."""
server_group = cs.server_groups.create(name=args.name,
diff --git a/releasenotes/notes/bug-1767287-cc28d60d9e59f9bd.yaml b/releasenotes/notes/bug-1767287-cc28d60d9e59f9bd.yaml
new file mode 100644
index 00000000..76dce988
--- /dev/null
+++ b/releasenotes/notes/bug-1767287-cc28d60d9e59f9bd.yaml
@@ -0,0 +1,6 @@
+---
+upgrade:
+ - |
+ The ``nova server-group-create`` command now only supports specifying
+ a single policy name when creating the server group. This is to match
+ the server-side API validation.