7 Commits

Author SHA1 Message Date
Sean McGinnis
2b8282bb1e
Use unittest.mock instead of third party mock
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>
2020-04-18 11:59:46 -05:00
Haikel Guemar
d512e4763d Drop pycrypto from tests dependencies
pycrypto is unmaintained for a while and requirements team advises using
pycryptodome or cryptography libraries instead (see openstack-dev thread
[0]).

troveclient uses pycrypto to generate random data/content in its tests
which does not require any specific cryptographic need. This commit
replaces it by os.urandom from Python standard library.

[0] http://lists.openstack.org/pipermail/openstack-dev/2017-March/113568.html

Change-Id: Ia43c5883a51e8412c4a238d127c13db39e863da1
2017-07-18 18:56:15 +02:00
Peter Stachowski
7c0d2c23c3 Add support for module-reapply command
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
2017-01-05 00:12:32 +00:00
Peter Stachowski
714c6e781c Add module-instance-count command
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
2017-01-05 00:11:59 +00:00
Peter Stachowski
8607ca8358 Add support for module ordering on apply
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
2016-08-25 04:10:18 +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
Peter Stachowski
cf8fee5fa6 Add suport for module maintenance commands
This adds support in the python API and Trove CLI
for module maintenance commands.  These commands include:

    - module-list
    - module-show
    - module-create
    - module-update
    - module-delete

Partially Implements: blueprint module-management
Change-Id: I54d37025275dee4731ad49ebbd21612c4464e4c4
2016-02-24 20:05:39 -05:00