Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: Ib83e626f51e6e01898bb7931c1660a1a548500f3
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Change-Id: I5da442bb2f1e634e6b3fe37a6ea3820cea1db96f
Currently, there is no way for the admin user to get databases of all
the projects, which is very important for auditing or billing purpose.
With this change, admin user can get all the database instances by
running:
$ openstack database instances list --all-projects
Change-Id: I318907b1d4a63017f4a6f7967312770f8784c1f4
Story: #2005735
Task: #33393
This replaces the deprecated (in python 3.2) unittest.TestCase method
assertRaisesRegexp() with assertRaisesRegex().
Change-Id: Ib260a6549a7a957fc1b91b89156a676922142b04
Signed-off-by: Chuck Short <chucks@redhat.com>
Handles API part implemented in change:
I7c0a22c6a0287128d0c37e100589c78173fd9c1a
So far passing configuration group was possible only for single instance
deployment.
As the trove api now already supports configuration attach and detach
for clusters, we are able to handle it in client.
Configuration will be applied to each cluster instance.
Partially implements: blueprint cluster-configuration-groups
Change-Id: Ic0840c995cbc34203c76494d7ba522f3e17141a7
Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
User can specify the number and volume of mongos/configserver with
extended_properties argument when creating mongodb. Currently,
the supported parameters are, num_configsvr, num_mongos,
configsvr_volume_size, configsvr_volume_type, mongos_volume_size
and mongos_volume_type.
Change-Id: I35406f9967ce00a51b320eda37572e96228b209d
Signed-off-by: zhanggang <zhanggang@cmss.chinamobile.com>
There's now a seperate module 'builtins' from python-future(this package
is now installed by stestr, and stestr in required by oslotest-3.6.0),
so under Python 2.x 'builtins' is also imported as a module and
'bultins.open' is mocked instead of '__builtin__.open'. And according to
the Mock document, we should always patch the object where it's looked
up, so only necessary mocking is made in this patch.
Change-Id: I57ea61cefd3b01b19475b0fa7e16f716eaaa14e6
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
The parameter 'backup' in backup-create is never read by our Trove API[1], so
I guess it's a extra key argument for history reason. In addition, the
'backup-copy' subcommand should be removed as well because it does not
support in current Trove API.
[1] https://github.com/openstack/trove/blob/master/trove/backup/service.py#L61-L77
Change-Id: I33d439e0037efd4573eeae186758fd778ba5c514
To facilitate the concept of live-update, a new command
'reapply' has been added to reapply a given module
to all instances that it had previously been applied to.
Originally, a module designated live-update would automatically
be re-applied whenever it was updated. Adding a specific
command however, allows operators/users more control over
how the new payload would be distributed. Old 'modules'
could be left if desired, or updated with the new command.
Change-Id: Ic4cc9e9085cb40f1afbec05caeb04886137027a4
Partial-Bug: #1554903
Depends-On: I4caf4a57226dd711575cde766076fa25d16792e2
Added a --count_only flag to the call for module instances
to return a summary of the applied instances
based on the MD5 of the module (this is most useful
for live_update modules, to see which ones haven't been
updated).
Added a new module-instance-count command. This was done
to facilitate getting the summary, since it returns
a different result set. It basically calls the
same python interface as module-instances, but adds
the --count_only flag.
Also added some missing tests.
Change-Id: Iea661166bf3a4f3520a590da5954aedcd0036243
Partial-Bug: #1554900
Depends-On: I4caf4a57226dd711575cde766076fa25d16792e2
Add trove client support for new volume-types listing and datastore
version association listing.
Co-Authored-By: amrith <amrith@tesora.com>
Change-Id: Iafcd8d068b85c1993fac0471c04e57478c122bfe
Depends-on: I790751ade042e271ba1cc902a8ef4d3c3a8dc557
Implements the Clusters.upgrade python API and corresponding
shell command.
Implements blueprint: bp/cluster-upgrade
Change-Id: Iedb08c99bf8eb2a0b0d09e3c1ebd11965fdfff90
When trying to create an instance of size 0 an error is thrown
stating that the size was not specified, this is not correct
because I did specify it. The problem is that args.size evaluates
to False because size is 0.
This patch checks for size being zero instead and throws the correct
error message.
Change-Id: If00e83ccd919429dcfac7621dbbd9daa49f8b416
Added --incremental flag to backup-create and set the default
value to False. When the flag is passed it will create a
backup based on the last good known full/incremental backup.
If there is no previous backup a full backup will be created.
Change-Id: I96498180890b8b1692b1bac3b19988532f6eb077
Partial-Bug: #1607429
Client side of being able to specify 'priority' modules plus a
way to rank the order in which modules are applied. Two new
attributes 'priority_apply' and 'apply_order' have been added
to the python API and are supported in the CLI by means of the
module-create and module-update commands.
Partially Implements: blueprint module-management-ordering
Change-Id: I2b871c7d1eab634174396bd0905329f3a66755f6
Sometimes an instance/cluster can be stuck in BUILD state forever.
Attempting to delete the instance in this state is currently not
allowed. Add force-delete and reset-status command. Reset-status
will reset the status to ERROR, letting the instance/cluster be
deleted. Force-delete will combine functionality of reset-status
and delete.
Change-Id: I957b4be5030e493e0eb8c6b6855d41b942b2823c
Partial-Bug: #1579141
This change includes a new "trove upgrade" CLI command and
a new "Instances.upgrade" python API method to implement
the new Instance Upgrade feature.
Change-Id: I6ec2ebb78019c014f87ba5d8cbfd284686c64f30
Implements: blueprint image-upgrade
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
In order to allow clusters to be all on the same hypervisor
(affinity) or all on different hypervisors (anti-affinity) a new
argument (locality) needed to be added to the Trove cluster-create API.
This changeset addresses the Trove client part of this feature.
A --locality flag is now available on the 'cluster-create' command and
is passed to the server for processing.
Partially implements: blueprint replication-cluster-locality
Change-Id: Ie46cfa69ffe6a64760aca38c495563f5724bd0d0
In order to allow replication sets to be all on the same hypervisor
(affinity) or all on different hypervisors (anti-affinity) a new
argument (locality) needed to be added to the Trove create API.
This changeset addresses the Trove client part of this feature.
A --locality flag is now available on the 'create' command and
is passed to the server for processing.
The --replica_count argument was also cleaned up in that it's not
passed on unless it is set. If --replica_of is specified, the
default is set to '1.'
DocImpact: New functionality
Partially implements: blueprint replication-cluster-locality
Change-Id: I18f242983775526a7f1e2644302ebdc0dac025cf
'trove create' only accepts a backup id as a value
when restoring an instance from a backup. This change
enables the use of the backup name as well.
A few minor typos were fixed as well to make the output
more consistent.
Co-authored-by: Sushil Kumar <skm.net@gmail.com>
Co-authored-by: Peter Stachowski <peter@tesora.com>
Change-Id: I01f9ba96c8bdec5cfa4c4b477eb824b4456774d1
Closes-Bug: #1513636
When running py27 or py34 tox tests, a '4321_4321_4321.dat' file is
created and not cleaned up. This is due to a missing mock in the
module_retrieve test.
The 'open' method is now mocked and the file is not created.
Change-Id: I8e2524961b3cb2ac01b65d5ce11d476ad3a81662
Closed-Bug: #1565959
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
Add api entry points for root-disable to the Trove client.
Added unit tests.
Change-Id: I27831eb361c2b219a9623f152b9def73a2865d67
Partially implements: blueprint root-disable
DocImpact: added new root-disable CLI command
An optional Cinder volume-type parameter was added to the instance
create command.
Also allow for 'volume_type' parameter in cluster create.
Note:
Had to change the way arguments get split.
Splitting by just 'volume' would conflict with
the 'volume_type' property.
Change-Id: Ied40b30ca738d815ca0a57971bb59f29ddc20b91
Implements-Blueprint: volume-type-on-create
Standalone instance create call in trove already accepts neutron
networks and availability zone information.
In the similar manner, instances which are part of the cluster can
now be supplied with a specific neutron network information and
availability zone.
Instance parameter now includes flavor_id, volume, network
and availability_zone.
We are now spliting the cluster create arguments by trove cluster
arguments. Then dealing with each sub-parameters individually.
Co-Authored-By: Saurabh Surana <saurabh.surana@hp.com>
Co-Authored-By: Sharika Pongubala <sharika.pongubala@hp.com>
Change-Id: I25af22d3a48b728e59d93f959cf8646d54973d2e
Partial-Bug: #1447350
Adds support for root-enable for Vertica clusters,
with optional user-provided passwords.
Fixes backward compatibility issue.
Implements blueprint: vertica-cluster-user-features
Change-Id: I3e23c87c0e48a7f910e54207116fc75b5ce0ad0c
Implements the CLI and python-API methods to support the
clustering commands, including the new cluster scaling
commands.
Change-Id: Icc9b4eea8ed7db1455692823d29586088cfc9434
Implements: blueprint redis-cluster
Adds support for root-enable for Vertica clusters,
with optional user-provided passwords.
Implements blueprint: vertica-cluster-user-features
Depends on: I0a39cae53b371d1a89a6abbf93d026b16a665ed8
Change-Id: Ic9d81ab0e840d699c052c6b0fdccaeec5d69a5b4
This change makes following subcommands accept flavor name and cluster
name.
- create
- cluster-create
- cluster-delete
- resize-instance
The change also remove resize-flavor command.
DocImpact
Closes-Bug: #1463274
Change-Id: I4da69280987ce8d6da33da0c7fb1ec8b35abe25d
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
Following files were too low on code coverage,
so the coverage has been enhanced with addition of more unit-tests.
- troveclient/client.py
- troveclient/v1/shell.py
The methodology to test shell.py has been motivated from the
one used by python-novaclient to test novaclient/v2/shell.py
Also, found an unmocked entry in test_secgroups.py,
which was causing intermittent failure while
writing the tests for shell.py.
Closes-Bug: #1455856
Change-Id: I6a148fb5caad6a83b6ac23411b6458f231064ead