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: I4a5b1ec999110a50fc904f3ae93e3983efa64f88
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The repo is Python 3 now, so update hacking to version 2.0 which
supports Python 3.
Fix problems found.
Change-Id: I81cf5e317bb2f791888e75d87cfd27dfdd2b5f96
UT Coverage for following is increased:
- magnumclient/tests/v1/test_certificates_shell.py
- magnumclient/tests/test_utils.py
Change-Id: If15aaf9206599126dde14d237bb56b52222ea0cf
Partially-Implements: blueprint magnumclient-ut-coverage
Magnum allows "labels" to be Dict of string, but currently
magnumclient creates a list of values if same key is specified
more than once when creating a baymodel.
Now if two labels of same key are passed to baymodel-create
the first value is joined with second using comma.
Change-Id: Idcee5c27e29b8d6889fd2c9fa839202ffb8a2f4e
Closes-Bug: #1521461
mesos_slave_executor_environment_variables is a file path to deliver
the data for mesos executor environment variables, and validate the
file if existing or matching the json form.
Change-Id: Iaeb912184f8789321526887d25e281b5181089ef
Partially-Implements:blueprint mesos-slave-flags
Now using 'comma' split the labels list result in the fail when some
value in labels list has comma, for example, mesos_slave_isolation=
docker/runtime,filesystem/linux
The patch fix the bug that some value in labels list has comma will
fail.
Change-Id: I1553b512e4e2efa7677efadf44e959f1601d39ad
Closes-Bug: #1578498
When running the command "magnum container-list --limit -1 --bay
swarmbay" with "--limit -1" , it can get the containers successfully.
Change-Id: I359a9b90bd80cfeb97db2ada8fb1ada0f5eb127e
Closes-Bug: #1562790
* can use commas or semicolons in label list
* add two tests, all semicolons and mixed
semicolons and commas
Closes-bug: #1497042
Change-Id: I6c243b09343b92fc54a991facf874d1e5f0f1f51
According to the doc[1], initialize OrderedDict as below won't
perserve the order:
collections.OrderedDict({...})
This causes occasional failures of the tests. This patch changed it
to:
collections.OrderedDict([...])
[1] https://docs.python.org/3/library/collections.html#
ordereddict-objects
Change-Id: I863f9d2879a6c119501fe1d5175ecb8a70e7e9f1
Closes-Bug: #1556475
There's no u'' in python3.4, strings are always unicode or bytes in
python3. use six.u() to convert strings.
Change-Id: I96be4305476ea74b4a2931fab550e8c21f1c8fad
Apiclient[1] and cliutils[2] is removed form Oslo incubator, we should keep
the local copy by ourself.
1. copy openstack/common/apiclient to common/apiclient
2. only keep base, auth, exceptions from apiclient, others are unused
3. copy openstack/common/cliutils.py to common/cliutils.py
4. update all magnumclient.openstack.common.* users to use
magnumclient.common.*
This is the first step to delete openstack common modules.
[1] Change: I2020d73fa9cedb3b3b87c1d8dbc8d437857ec7c2
[2] Change: Ibc5a8f11c6e5c308cec15a60eeb07a898254f9b7
Partial-Bug: #1545957
Change-Id: Ide3814d87ecdf3255868bf3b78fdceb58bd14295
Fix the assert of dictionary equality in test_keys_and_vals_to_strs
as the dictionary order can cause the test to fail.
Change-Id: Iaa0c7bf6cbcb456451d287c7ba8d9e2829e4edc5
Closes-Bug: #1532834
Since oslo-incubator is no longer maintained[1] after
90ae25e38915cc502d9e9c52d59e8fb668a72ae1. We should cleanup
the deprecated code.
This patch do the following cleanup actions:
1. Use magnumclient.i18n instead of
magnumclient.openstack.common._i18n.
2. Use magnumclient.exceptions instead of the deprecated
magnumclient.openstack.common.apiclient.exceptions[2].
[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/
079343.html
[2] https://github.com/openstack/python-magnumclient/blob/master/
magnumclient/openstack/common/apiclient/exceptions.py#L25
Change-Id: I6fae1f84d211d661bb363e43167cdf8b6b06fd4d
Partial-Bug: #1529316
When a Magnum resource has an attribute that is implemented as a dictionary,
and that dictionary contains either unicode keys or unicode values, then
the Magnum client show commands display the dictionary keys/values
including a preceding 'u' character. For example, the output of the
'magnum baymodel-show <baymodel>' command includes this line:
| labels | {u'flannel_network_subnetlen': u'26',
u'flannel_network_cidr': u'10.101.0.0/16',
u'flannel_use_vxlan': u'true'} |
This patchset adds a recursive conversion of a dictionary's keys and
values from unicode to strings before the contents of the dictionary
are printed by the Magnum client.
Change-Id: I0fdc1f1d2dfc693652307ac66622c24f03899f8d
Closes-Bug: #1498071
Adds labels attribute and associated tools/tests to the magnum
client.
Implements: blueprint extend-client-network-attributes
Change-Id: Ie8465275646b82aa9bd7a9de756c519bdd6ec0e2
Users can use these commands to add/remove/update bay attribute(s):
magnum bay-update <bay_id> replace <path=value>
magnum bay-update <bay_id> add <path=value>
magnum bay-update <bay_id> remove <path=value>
For example, this command updates the node_count attribute of a bay:
magnum bay-update 0aab40ba-3f48-4e6e-88a6-247be18b9711 replace node_count=1
Change-Id: If003beaca8e7e8bbdff2cf24d2810b0db9efdf41
Implements: blueprint update-node-count