The output of list make nice labels from fields. Fisrt, replace
underscore with space. Then, replace "id" with "ID". Finally,
capitalize each word. This works fine for "*_id"(for exmaple,
"flavor_id" will be replaced to "Flavor ID"), but when a word
has a "id" inside, it will be wrong. For example, "cidr"
will be replaced to "CIDr", actually it should be "Cidr".
This change fix the problem, only "id" after a underscore will be
replaced to "ID".
Change-Id: I8e357c946b21dc6f6c6c79d78a45f23b440a57da
Not like nova-delete when use trove-delete there is only support
delete an instance everytime. With this patch, we can delete
many instances or clusters in the same call, like
trove delete instance1 instance2.
Change-Id: I6bb0c406ba7f4c0e43cddfdff1d156b7e82ffa7a
According bug description, not like nova-delete when use trove-delete
there is no message or alert is generated. To solve this problem, I
added some message when normally execute deleting instance or cluster.
Change-Id: I572a24116fd1abec220f49a3f9705a5c071155bf
Closes-Bug: #1569669
Now troveclient does not support returning Chinese characters, so
to make changes.This should also avoid other unicode output
problems
Change-Id: Ie948cff4e81806f17c697f50271992cc492c48f4
Closes-Bug: #1720490
Fix a bunch of formatting issues with docstrings to allow us to turn on
the flag that treats warnings as errors to avoid mal-formed
documentation in the future.
Change-Id: Ic6fb73031e37314c49c41e4621dfd92b9c3f59d5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Under a keystone V3 scenario, the CLI command for
module-list will fail as it tried to determine whether
to display the 'visible' and 'tenant' fields (which only
make sense to show to an admin).
Keystone V3 stores the role information (used to find
out if the user has admin access) in a different
place than V2. This fix uses a keystoneauth1 property
to have the value determined correctly internally,
so trove doesn't have to worry about it.
The logic was also moved to the utils module to
faciliate reuse.
Closes-Bug: #1622019
Change-Id: I6dbc3660b507017f85d06bde2903f4d2334fea35
As part of the first community-wide goal [1], teams were asked
to remove the openstack/common package of their projects
if one existed. This was a byproduct of the old oslo-incubator
form of syncing common functionality.
The package, apiclient, was moved to a top level location
and cliutils was moved to the common module. There are no oslo
specific libraries, the recommended solution is to move it
in tree and maintain it there.
Specifically in this patch, I also rearranged some of the
imports to make them match up with the hacking guidelines
while I was re-ordering them for the refactor anyway.
Lastly, the apiclient/fake_client.py was deleted since it
was not used.
[1] http://governance.openstack.org/goals/ocata/remove-incubated-oslo-code.html
Change-Id: Ib7b691240b819c9c91b100ca47ffaba75b281c78
Oslo provides a function, to_slug() in strutils that is substantially
similar to slugify() provided in utils by python-troveclient. Remove
slugify() and use to_slug() instead.
Change-Id: I97bc7cfc2c0e7d14e7617037bff431cdc1eee50f
Closes-Bug: #1266127
Author: Christian Berendt <berendt@b1-systems.de>
When Trove moved to support alphanumeric flavor ids, the case of having
a numeric string id with leading zeros was not taken into account. The
behavior on the client side is to see if the id is all digits, and if so
it is converted to an int. That means that a flavor of '01' will be
incorrectly interpreted as '1'.
This behavior has been fixed and unit tests created.
Change-Id: I5acdec576a2e7da6cbfbb1cfc61c49fbbf7379af
Partial-Bug: #1603187
This adds support in the python API and Trove CLI
for instance module commands. These commands include:
- module-apply
- module-remove
- module-query
- module-retrieve
- module-list-instance
The parsing of --instance was modified to allow multiple
modules to be specified. This was extended to 'nics' as well.
Partially Implements: blueprint module-management
Change-Id: If62f5e51d4628cc6a8b10303d5c3893b3bd5057e
flavor-show fails if the flavor's ID is in the form of UUID
and user specified its name.
The change in troveclient/v1/shell.py#L92-L95 is from Sushil Kumar.
Closes-Bug: #1467383
Change-Id: Ie838796191a06193a59499da59fae79b9d9f060f
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: I2a8caa859830b3416bfe54e4261dd3415ac5a76a
The python-troveclient module still had references to strutils, and
gettextutils which are now obsolete.
Change-Id: Ia54a565c00966b0a1cb5f18c6e17e1237b2bfee6
Partial-Bug: #1380789
When a nova flavor's id is a string and not an int, Trove will
return None for the flavor's id and instead expect clients
to use the str_id field. This updates the shell mask this
from the user and always present the relevant value as id, and
allow specifying either str_id or id for flavor-show.
find_resource() was updated to deal with ints and strings, not just
UUIDs and ints.
Relies on changes to Trove @ https://review.openstack.org/#/c/115811
Related-bug: #1333852
Change-Id: If08430b07b7e8b6a1737f3e71dba6a471de63794
Updates the condition to test global symbol 'json_output' and
print results accordingly.
Change-Id: Ib1d5d45413b4652456c05bda6304701b0ce23a06
Closes-Bug: #1322461
Added ability to pass in header labels to print_list.
If not passed in, header lables are automatically created
from the fields by replacing '_' with spaces and capitalizing
each word. IDs are also capitalized. All field data is
now left-aligned, except numerics which are right-aligned.
Also changed print_dict so that all values are left-aligned.
Change-Id: I3b69dc7f92c496594cf37832f4ff98f1abdf52dd
Closes-Bug: #1272700
Reasons:
- The security group rule create call was expecting
from_port, to_port, and protocol as arguments, but
the Trove API was ignoring these since it picks these
up from the respective datastore confs.
Changes:
- Removing the extra arguments from the security-group-rule
create command:
- from_port
- to_port
- protocol
Note that even though the user was able to specify the ports
for the rule these were _never_ being honored since these
were being picked up from the respective config files.
Usage before change:
- trove secgroup-add-rule <security_group> <protocol>
<from_port> <to_port> <cidr>
Usage after change:
- trove secgroup-add-rule <security_group> <cidr>
Change-Id: Ic1440f735b6cf2b8b4f29c5ab9f48bcb427ca9e6
Closes-Bug: #1298749
We will no longer support XML for the trove API; it behooves us to
remove XML related code, and clean up the trove client.
Partially implements bp: destroy-xml-api
Change-Id: I58f95e81f3e4bc4bad277ff2a48abfced2b48199
extensions on the contrib path (i.e. troveclient/v1/contrib/*.py),
extensions on the python path that follow the naming convention of
*_python_troveclient_ext, and entry-points will now be discovered
and loaded.
due to the mismatch of the api version and the troveclient
package name, '1.0' vs. '1', the client has been patched to look
for contrib in troveclient/v1 vs. the standard troveclient/v1_0
Change-Id: I3ea7bb5ba471b0d421581dcfda7216f429cb7b65
Closes-Bug: #1267577
Improvements for client:
- added datastore field in instances list
- fixed datastore and version fields in instance show output
- fixed mistakes in help texts
- add possibility to retrieve version by uuid (without specified datastore)
Implements: blueprint datastore-type-version-followon
Change-Id: Id41da29ce9732823bc4696301953e9cf8cdc82f5
In Python 3, all string is unicode.
Replace unicode() with six.u()
Make use of strutils.to_slug() for slugify() definition
Partial implements: blueprint py33-support
Change-Id: I6a1e19c095a2fbafcbe47b34c7af17e1b0353b9e
The new client adheres to the standards of the other clients
now. It prints out tables, uses ENVVAR's for auth, no longer
stores pickled json in a login token, uses openstack common,
and moves the cli operations into a v1 module for the future
of trove when it has a v2 api.
Please note for compatibility, the troveclient.compat module
has the old cli. In order to deploy it, amend the setup.cfg
to include the compat module.
implements blueprint cli-compliance-upgrade
Change-Id: Ie69d9dbc75ce90496da316244c97acca1877a327
Some files still use trademark OpenStack LLC in header, which
should be changed to OpenStack Foundation.
Change-Id: Ib30cd06cdd13b9f949e028753716aa55736f4a40
Fixes-Bug: #1214176
Instead of globally disabling pyflakes warnings,
disable only those that occur frequently and
fix the rest. Enable gating on those.
Change-Id: I774d809ebcda2339b30c104b031211a3b2c491bd