27 Commits

Author SHA1 Message Date
Steve Martinelli
eed19c835f move old apiclient code out of openstack/common
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
2016-11-10 10:02:08 -05:00
Christian Berendt
b592b42aa1 Use strutils.to_slug() instead of utils.slugify()
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>
2016-09-06 10:17:51 +09:00
Peter Stachowski
f067cf83c2 Support flavor ids with leading '0'
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
2016-07-14 22:33:28 +00:00
Peter Stachowski
457360c69f Client support for instance module feature
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
2016-03-11 18:10:50 -05:00
Masaki Matsushita
29d0703de1 Fix flavor-show problems with UUID
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
2015-06-29 10:13:12 +09:00
Doug Hellmann
8612fd048d Drop use of 'oslo' namespace package
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
2015-05-06 19:45:44 +00:00
Amrith Kumar
dca7bfe1e6
Handle obsolete and unused oslo modules
The python-troveclient module still had references to strutils, and
gettextutils which are now obsolete.

Change-Id: Ia54a565c00966b0a1cb5f18c6e17e1237b2bfee6
Partial-Bug: #1380789
2015-01-23 07:49:23 -05:00
Adam Gandelman
a90a669c9c Fallback to flavor's str_id when id is None
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
2014-12-12 16:05:56 -08:00
Sushil Kumar
f4e970dfca Corrects trove-client output
Updates the condition to test global symbol 'json_output' and
print results accordingly.

Change-Id: Ib1d5d45413b4652456c05bda6304701b0ce23a06
Closes-Bug: #1322461
2014-05-23 17:14:52 +00:00
Jenkins
045f6791bb Merge "Enabled F821, H306, H402, and H404 flake8 rule" 2014-05-23 04:59:20 +00:00
Sushil Kumar
8bc695bd70 Enabled F821, H306, H402, and H404 flake8 rule
Reasons:
- F821 is disabled.
- H306 is disabled.
- H402 is disabled.
- H404 is disabled.

Changes:
- Updates tox.ini to enable F821, H306, H402 and H404 rules.
- Updates code for F821, H306, H402 and H404 violation.

Change-Id: I772270bb833ac774e080fc63e330d6b333f23de2
2014-05-09 08:54:39 +00:00
Peter Stachowski
c2b501d91b Changed Trove CLI list headers to match Nova CLI
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
2014-04-24 14:58:08 -04:00
Denis Makogon
b9507417fe Fix create call for security group rules
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
2014-04-01 18:51:19 -07:00
Nikhil Manchanda
bbd51cfe30 Get rid of XML related trove client bindings
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
2014-03-16 21:34:49 -07:00
He Yongli
59ec2bb433 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: I45766d91f0c0b3622bbdc7dc5517497c87ebee8c
Closes-Bug: #1229324
2014-02-16 13:08:07 +08:00
amcrn
fce98a9173 Support Extensions to Trove Client
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
2014-01-23 11:11:58 -08:00
Andrey Shestakov
c6a54f7e1c Datastores improvements
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
2014-01-21 20:24:43 +02:00
Sushil Kumar
d56111cb07 Fixed misspellings of common words
Fixed misspelling of common words found by the 'misspellings' tool.

Change-Id: I8e03379f92b62fd4856bbc74b7e4641226a403d3
Closes-Bug: #1257531
2014-01-14 03:39:07 +00:00
Debasish Chowdhury
9c7120959e Removes unused import statements
Change-Id: If229aa3f6e1009e1abfba13aba3970bdf2dd3761
closes-bug: #1255885
2013-11-30 18:52:19 +05:30
Nick Shobe
60e0471b88 Allow --json output override printing dict/list
Change-Id: Ib02f244cb969ac8dfc92ac94e6e915063d13764d
2013-11-21 02:23:50 -06:00
Jenkins
ca4cad8a6c Merge "Fix unicode issue" 2013-10-23 15:37:15 +00:00
Michael Basnight
af4d4ed4f7 Fixing copyright and license headers
* Added HP copyrights as appropriate

Change-Id: If4f30b0caf03b16f5fb4f54185ba80d9fa41d0b0
2013-10-22 11:21:33 -07:00
Kui Shi
59b0f1c27a Fix unicode issue
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
2013-10-21 20:51:15 +08:00
Michael Basnight
fd43cbd73b Massive refactoring to the troveclient
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
2013-10-09 19:21:08 -07:00
ZhiQiang Fan
e3a301ff28 Replace OpenStack LLC with OpenStack Foundation
Some files still use trademark OpenStack LLC in header, which
should be changed to OpenStack Foundation.

Change-Id: Ib30cd06cdd13b9f949e028753716aa55736f4a40
Fixes-Bug: #1214176
2013-09-20 05:09:59 +08:00
Dirk Mueller
4ddb58ce9e Start using pyflakes
Instead of globally disabling pyflakes warnings,
disable only those that occur frequently and
fix the rest. Enable gating on those.

Change-Id: I774d809ebcda2339b30c104b031211a3b2c491bd
2013-06-26 13:48:18 +02:00
Michael Basnight
9916c8f273 Rename from reddwarf to trove.
Implements Blueprint reddwarf-trove-rename

Change-Id: Ib2d694c7466887ca297bea4250eca17cdc06b7bf
2013-06-21 20:15:23 +00:00