diff options
| author | Matt Riedemann <mriedem.os@gmail.com> | 2018-02-19 13:14:58 -0500 |
|---|---|---|
| committer | Matt Riedemann <mriedem.os@gmail.com> | 2018-10-25 16:25:28 -0400 |
| commit | 4944d4eaa9aaeffdee358680550ac7d7f0c6e8d8 (patch) | |
| tree | f32120b9675de096dc2303b6c96f0806547cee7c /openstackclient/tests/functional | |
| parent | a12cee60c745b6eabb7c791eafd7c9adad0a916e (diff) | |
| download | python-openstackclient-4944d4eaa9aaeffdee358680550ac7d7f0c6e8d8.tar.gz | |
Default --nic to 'auto' if creating a server with >= 2.37
Compute API version >= 2.37 requires a 'networks' value in
the server create request. The novaclient CLI defaults this
to 'auto' if not specified, but the novaclient ServerManager.create
python API binding code does not, as it wants clients to be explicit.
For the purposes of the OSC CLI, we should follow suit and if the
user is requesting OS_COMPUTE_API_VERSION>=2.37 without specific
nics, we should just default to 'auto'.
Change-Id: Ib760c55e31209223338a4086ff1f4fee88dc6959
Closes-Bug: #1750395
(cherry picked from commit 1008544882fbdae16b045abca05cf3e2e8a14787)
Diffstat (limited to 'openstackclient/tests/functional')
| -rw-r--r-- | openstackclient/tests/functional/compute/v2/test_server.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openstackclient/tests/functional/compute/v2/test_server.py b/openstackclient/tests/functional/compute/v2/test_server.py index bba16f62..3cb72d9f 100644 --- a/openstackclient/tests/functional/compute/v2/test_server.py +++ b/openstackclient/tests/functional/compute/v2/test_server.py @@ -618,7 +618,9 @@ class ServerTests(common.ComputeTestCase): server_name ) except exceptions.CommandFailed as e: - self.assertIn('nics are required after microversion 2.36', - e.stderr) - else: - self.fail('CommandFailed should be raised.') + # If we got here, it shouldn't be because a nics value wasn't + # provided to the server; it is likely due to something else in + # the functional tests like there being multiple available + # networks and the test didn't specify a specific network. + self.assertNotIn('nics are required after microversion 2.36', + e.stderr) |
