4692 Commits

Author SHA1 Message Date
Matt Riedemann
5b3a827a1f Provide stderr in exception when check_parser fails
For negative tests that are asserting an argparse failure
it would be useful to assert the specific reason for the
failure in the test rather than just getting an exception,
especially to avoid false positives in the tests when what
is being tested and failing isn't the actual expected reason
for the failure.

This wraps the check_parser code that parses the args and
mocks sys.stderr so we can trap that output and put it in the
exception message that gets raised to the test.

As a result, we can tighten up a test that was passing before
for the wrong reason [1].

[1] https://review.opendev.org/#/c/673725/12/openstackclient/tests/unit/compute/v2/test_server.py@605

Change-Id: I0f1dc1215bdfb3eba98ccaf66a0041d220b93812
2019-11-20 13:39:40 +00:00
zhangbailin
874a726f52 Microversion 2.79: Add delete_on_termination to volume-attach API
Added ``--disable-delete-on-termination`` and
``--enable-delete-on-termination`` options to the
``openstack server add volume`` command that enables users to mark
whether to delete the attached volume when the server is destroyed.

Depends-On: https://review.opendev.org/#/c/681267/

Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I6b5cd54b82a1135335a71b9768a1a2c2012f755b
2019-11-19 21:07:20 +00:00
Zuul
c6a171f010 Merge "Refactor AggregateTests" 2019-11-06 05:59:24 +00:00
Eric Fried
3b409e4d0e Refactor AggregateTests
While investigating the referenced story/bug I noticed that
wait_for_status in
openstackclient.tests.functional.compute.v2.test_aggregate.AggregateTests
was doing a lot more than it should ever need to (it probably got copied
in from somewhere). The two places calling it only need to a) check the
output of `openstack aggregate show`, and b) try once -- since they just
got done creating the aggregate synchronously, there should never be a
need to delay/retry. So this commit removes the helper method and just
inlines the check.

At the same time, the addCleanup(aggregate delete) directives are moved
above their respective creates. This is a defensive best practice which
makes sure cleanup happens even if something fails very soon after the
actual back-end create (as was in fact the case with the referenced
bug/story).

It is unknown whether this will impact the referenced bug.

Change-Id: I0d7432f13642fbccd5ca79da9c76adfcbabb5fa9
Story: 2006811
Related-Bug: #1851391
2019-11-05 21:32:15 +00:00
Eric Fried
e2d8dc0f1c Deflate .htaccess
Use some regexes to reduce the number of lines in .htaccess and
hopefully make it slightly clearer which groupings of files redirect to
which new locations.

Also collapse one redundant double-redirect.

Change-Id: I65c4960856985d71076291f175df17f27a5ab8cc
2019-11-05 07:09:05 -06:00
Eric Fried
6f07828bf0 Add redirect testing
Adds a dependency on and invocation of the `whereto` command to validate
redirects in the .htaccess file during doc builds.

Change-Id: Ib6cc2953f0fd774de3c3a0c8a2bd6cff49667c14
2019-11-05 07:09:05 -06:00
Eric Fried
c6266b5ab2 compute: autogenerate docs
$namespace = openstack.compute.v2

The subcommand documents for $namespace were hardcoded and thus prone to
drift over time. This commit removes the hardcoded content and uses the
autoprogram-cliff directive to generate them automatically from the
subcommand configuration classes.

Many of these were already being generated. Some were missing a few
sub-subcommands, so those are added.

Change-Id: I1aa4b2655bafd2f6a5d83b658742f65d180eb128
2019-11-05 07:09:05 -06:00
Eric Fried
da56b8f4cf openstack.cli: autogenerate docs
$namespace = openstack.cli

The subcommand documents for $namespace were hardcoded and thus prone to
drift over time. This commit removes the hardcoded content and uses the
autoprogram-cliff directive to generate them automatically from the
subcommand configuration classes.

Change-Id: I1f7e9d0e5748f887dbc35200c3c8b4407da43e0b
2019-11-05 07:09:05 -06:00
Eric Fried
4c0f3bfa89 common: autogenerate docs
$namespace = openstack.common

The subcommand documents for $namespace were hardcoded and thus prone to
drift over time. This commit removes the hardcoded content and uses the
autoprogram-cliff directive to generate them automatically from the
subcommand configuration classes.

This incorporates a correction to `openstack versions show`: The command
`openstack versions show --help` showed a copy/paste error, using
<region-name> for the metavar for both --service and --status. Fix.

Change-Id: I7658fed40d71f4c20ee27908ade433534657cfe5
Co-Authored-By: Pierre Prinetti <pierreprinetti@redhat.com>
Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
2019-11-05 07:09:05 -06:00
Eric Fried
c7dbe85705 Update a stale doc reference to use :neutron-doc:
The help page for network auto allocated topology had a link to a
newton-era networking guide document that has been superseded and is
now maintained in the neutron repository.

This commit adds 'neutron' to the openstackdocstheme configuration so
that the :neutron-doc: role works, and updates the link to point to the
modern version therein.

Change-Id: I5bcb40e265b22f15ff2f5ca4936160e231bb4075
2019-11-05 07:09:05 -06:00
Zuul
d17a1c8039 Merge "neutron: autogenerate docs" 2019-11-05 00:41:31 +00:00
Zuul
d2f44e645e Merge "Use autoprogram-cliff for remaining plugin docs" 2019-11-04 22:09:27 +00:00
Zuul
10747754a6 Merge "Use SDK to get compute API extensions" 2019-11-04 22:09:23 +00:00
Eric Fried
cd6c285cc6 neutron: autogenerate docs
$namespace = openstack.network.v2

The subcommand documents for $namespace were hardcoded and thus prone to
drift over time. This commit removes the hardcoded content and uses the
autoprogram-cliff directive to generate them automatically from the
subcommand configuration classes.

This one turned out to be quite involved, because we support both
neutron and nova-network. When running in a real cloud, the command
classes detect whether the neutron service is present, assume
nova-network if that service is not found, and only add parser options
relevant to the detected service. But the docs need to present both sets
of options. This was easy enough when they were hardcoded, but required
a bit of additional infrastructure for generated docs.

Change-Id: I426261eb1d86bcc68656aabd61f10b7f082da402
2019-11-01 14:24:30 -05:00
Pierre Prinetti
61ad83b575
versions: Fix 'versions show' help message
The command `openstack versions show --help` shows a copy-paste nit.

Change-Id: I9e4e86429ffd630c566bbdf2929e7995c9b0dbe1
Signed-off-by: Pierre Prinetti <pierreprinetti@redhat.com>
2019-11-01 11:25:40 +01:00
Matt Riedemann
4b393681d9 Use SDK to get compute API extensions
python-novaclient 16.0.0 removed the deprecated
list_extensions module [1] so this changes the
extensions command to use openstacksdk to get the
compute API extensions.

The functional test ExtensionTests.test_extension_list_compute
ensures this works.

[1] https://review.opendev.org/686516/

Change-Id: I9894bc395c0474aaa6494ac4534862efe4ea7984
Story: #2006769
Task: #37284
2019-10-31 16:48:29 +00:00
Eric Fried
f1d742f32a Fix functional tests for py3
Fix various things so the functional tests will work under python3:

- A hashlib.md5() can only be update()d with an encoded string in py3.
- There's no dict.iteritems(), change to dict.items() (which is already
  an iterator).
- Open temp files with 'w+' mode rather than the default 'w+b' (as an
  alternative to encoding all the write and expected-read payloads as
  bytes).
- (This is a weird one) Explicitly raise SkipTest from unittest (rather
  than unittest2, which is where cls.skipException landed). Not sure why
  this is busted, but this moves the ball.

Change-Id: Ic9b2b47848a600e87a3674289ae7ae8c3e091fee
2019-10-31 00:17:35 +00:00
Eric Fried
977b0c8591 Use autoprogram-cliff for remaining plugin docs
Sphinx errors have been fixed in the plugin projects for octavia, rsd,
trove, watcher, and zun, so we can now use autoprogram-cliff to generate
the docs for those.

Change-Id: Ia7790c5e86957afd0aec8f9a04ffc7aa968b4eeb
Story: #1735016
Task: #37241
2019-10-28 14:05:37 -05:00
Zuul
45af14ca72 Merge "Doc: launchpad => storyboard" 2019-10-22 21:54:02 +00:00
Zuul
80d2ff41fc Merge "Remove plugin projects from test-requirements.txt" 2019-10-22 21:43:09 +00:00
Zuul
aeb094e765 Merge "Link to (some) plugin doc pages" 2019-10-22 21:43:04 +00:00
Zuul
77b5e9da35 Merge "Add plugin doc page for watcher" 2019-10-22 21:43:03 +00:00
Zuul
9974eb0453 Merge "Produce complete content for plugin docs" 2019-10-22 21:16:52 +00:00
Zuul
50325ff5ca Merge "Split plugin docs per project" 2019-10-22 21:16:49 +00:00
Zuul
e27a290087 Merge "Add placement to known plugins" 2019-10-22 21:16:47 +00:00
Zuul
86eddf701b Merge "Fix plugin autodoc generation" 2019-10-22 21:16:43 +00:00
Zuul
7e98aaefa9 Merge "Add parent project filter for listing projects" 2019-10-22 21:16:40 +00:00
Zuul
f873235625 Merge "Fix osc-lib interface change: catch osc-lib Forbidden" 2019-10-22 21:16:34 +00:00
Eric Fried
d0bfef807d Doc: launchpad => storyboard
A few docs still referred to launchpad, which osc hasn't used in a
couple of years. Cut over to storyboard.

Change-Id: Ic9abf0fe1e52c255976bd7a019e999a8e610455e
2019-10-22 15:13:40 -05:00
Eric Fried
fcae62841f Link to (some) plugin doc pages
We would like to use autoprogram-cliff to generate full docs inline for
each plugin. But for the following projects, that breaks the build:

- octavia
- rsd
- trove
- watcher
- zun

For those projects, we're using list-plugins instead, because that
builds, and it's better than nothing; but it only provides summaries of
the commands.

So with this commit, we add a link to the plugin documentation from the
actual plugin project where such documentation exists, which currently
is just:

- octavia
- watcher
- zun

(For rsd, I couldn't find openstack-published docs at all; for trove,
published docs exist, but the osc plugin isn't documented.)

Change-Id: I7c826ecef4319bead239e11b5f975302b2f24d1b
Story: #1735016
Task: #37244
2019-10-22 10:27:24 -05:00
Eric Fried
67a5654d49 Add plugin doc page for watcher
This was being omitted because whenever the plugin page was produced,
python-watcherclient wasn't in global-requirements. It is now, so
include a page for it in the plugin docs.

NOTE: We would like to use autoprogram-cliff to make the documentation
complete, but that breaks the build. For now, this is better than
nothing.

Change-Id: I49822242b9a0c031a053d6c2fd9f644a585f4ba5
2019-10-21 18:08:41 -05:00
Eric Fried
3fd63c0021 Produce complete content for plugin docs
Plugin documentation previously used ``.. list-plugins::`` for each
plugin command, which just produced the summary line. This might be
useful if there were also a link to the complete (per-project) docs for
the commands; but since we have the content available, we might as well
produce the complete plugin docs inline. That's going to be most useful
to a reader anyway.

So this commit switches from ``list-plugins`` to ``autoprogram-cliff``
-- except for the following, whose docs break the build when this is
done:

- octavia
- rsd
- trove
- zun

These fixups are tracked under task #37241 under this same story.

Change-Id: I2f17e203fe3da92a709884c9052c8e39ff87f4c8
Story: #1735016
Task: #37240
2019-10-21 17:45:35 -05:00
Eric Fried
85c83530ee Split plugin docs per project
Once [1] fixed plugin doc generation, the (single) page it produced was
unusably huge. This commit splits it into one page per project.

Note that there are four plugin projects that didn't have sections
included:

- cue
- murano
- tripleo
- watcher

These were noted in hidden rst which is preserved in the (new) index
page.

[1] Id9be39971110fd2eb4519a0582c9bf2514cdcacd

Change-Id: I0214ddb00a5a292a46d7cfb539d6dcc540fdae79
Story: #1735016
Task: #37239
2019-10-21 17:44:15 -05:00
Eric Fried
abdec78fa3 Remove plugin projects from test-requirements.txt
Plugin projects were listed in test-requirements.txt ostensibly to pull
them in for autodoc building. However, test-requirements.txt wasn't
being used for that purpose -- doc/requirements.txt was, so [1] added
them there. So this commit removes them from test-requirements.txt where
they're unused.

[1] Id9be39971110fd2eb4519a0582c9bf2514cdcacd

Change-Id: Ia89888ee05e17da636ee46894232624e0178d6bc
2019-10-21 16:37:41 -05:00
Eric Fried
8cdc7348d1 Add placement to known plugins
Add the osc-placement project (osc plugin for the placement service) to
the list of known plugins.

Change-Id: I77b614b38ecf872d0d93473b834994913930b76f
2019-10-21 16:11:09 -05:00
Eric Fried
cf1006bf0e Fix plugin autodoc generation
Documentation for plugins wasn't being generated because the plugin
projects weren't being installed in the docs environment. Add them to
doc/requirements.txt to make this work.

Change-Id: Id9be39971110fd2eb4519a0582c9bf2514cdcacd
Story: #1735016
Task: #13825
2019-10-21 16:10:56 -05:00
154df0d069 Update master for stable/train
Add file to the reno documentation build to show release notes for
stable/train.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/train.

Change-Id: I2cab236b14bc5eac173d815a634c8d8eb2afee04
Sem-Ver: feature
2019-10-04 13:06:18 +00:00
Zuul
371f5f5522 Merge "Add 'openstack server migrate (confirm|revert)' commands" 2019-10-03 11:19:48 +00:00
Andreas Florath
9ad3439689 Fix osc-lib interface change: catch osc-lib Forbidden
The patch https://review.opendev.org/#/c/673389/
introduced a regression by changing the osc-lib
interface.

The patch
https://review.opendev.org/683119
changes the exception from the generic CommandError
back to a specific Forbidden exception.

This patch catches this exception and passes on, i.e.
re-implements the same behavior as before.

Story: 2006547

Change-Id: I17b1ec7abaa5b0828ccbcad40bd928565c5c59fb
Signed-off-by: Andreas Florath <Andreas.Florath@telekom.de>
2019-09-19 11:59:11 +00:00
Zuul
aa64eb6b0a Merge "Update release table for Train and 4.0.0" 2019-09-11 19:35:52 +00:00
Zuul
06b49c03dd Merge "Clean up app initialization and config" 2019-09-11 07:08:54 +00:00
Dean Troyer
cb0c20b23c Update release table for Train and 4.0.0
Also clean up some docs and release notes.

Change-Id: I73feec747ca1bd12be5e5700c9ca608ed3a8b2c2
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-09-10 23:48:32 -05:00
Zuul
9101440c07 Merge "Add doc and relnote for review 639652" 2019-09-11 04:00:32 +00:00
Zuul
b7b124f327 Merge "More aggregate functional race chasing" 2019-09-11 02:29:28 +00:00
Zuul
71d805008b Merge "Default to Cinder v3 API" 2019-09-10 21:23:52 +00:00
Dean Troyer
de8ab5e8fd More aggregate functional race chasing
AggregateTests.wait_for_status() was a classmethod, those often
are sources of conflict in parallel testing...

Change-Id: I6211fd9c36926ca97de51a11923933d4d9d2dfda
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-09-10 14:09:29 -05:00
Stephen Finucane
609988ebac Add 'openstack server migrate (confirm|revert)' commands
While cold migration and resize are essentially the same operation under
the hood, meaning one could use the 'openstack server resize confirm'
and 'openstack server resize revert' commands instead, there is no
reason the operator needs to know this. Add these flags as syntactic
sugar to help simplify operators lives.

The help texts for both the 'openstack server resize' and 'openstack
server migrate' commands are updated to clarify the relationship between
the two operations.

Change-Id: I0cb6304c794bffaec785add9f7b8cf53ab28cacd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-09-10 13:45:41 +00:00
Zuul
e8a335b233 Merge "Fix typo: "to and endpoint"" 2019-09-09 16:12:26 +00:00
Zuul
d1385971bb Merge "Add floating IP Port Forwarding commands" 2019-09-09 16:12:23 +00:00
Zuul
678167a6bf Merge "Format location columns in network commands" 2019-09-09 15:48:24 +00:00