This patch is mainly porting from nova repository:
Adds:
1.tools/flake8wrap.sh
Will let developer use 'tox -epep8 -- -HEAD' to testing changes files
2.tools/pretty_tox.sh
Give pretty test trace when doing unit/functional testing.
Change-Id: Icedb4ed8b50532531e18784a1584fe63c5a9e017
Tests should use:
self.assertIn(value, list)
self.assertNotIn(value, list)
instead of:
self.assertTrue(value in list)
self.assertFalse(value in list)
because assertIn and assertNotIn raise more meaningful errors:
self.assertIn(3, [1, 2])
>>> MismatchError: 3 not in [1, 2]
self.assertTrue(3 in [1, 2])
>>> AssertionError: False is not true
Closes-Bug: #1510007
Change-Id: If33252cc93c06a85e61871fb7b22b726f4a08500
This patch will improve the comment below abstract method pull_data
which can be defined for pulling data from bay and pod as well but
comment says bay only.
Change-Id: I86cb822dc72bc9805d2c38405012206991110438
Developer should use assertIsInstance to replace the
assertTrue(isinstance(a, b)).
Closes-Bug: #1510384
Change-Id: I70f68a5810a6797c7b7e112b46ef2463907bba3e
apply_patch will convert patch parameter into JsonPatch, so we don't
need to do it. If we do, the parameter is JsonPatched twice.
Change-Id: I9f01089ee5f9a25c27d531ee60dc60a9c472c7fe
Closes-Bug: #1512206
Developer should use assertIsNotNone to replace the
assertEqual(** is not None).
Closes-Bug: #1510371
Change-Id: I5afd03aaf591e047b855bc416bc60fbc182bdc19
The usage of assertEqual(True/False, ***) should be changed to a more
meaningful format of assertTrue/False(***).
Closes-Bug: #1510001
Change-Id: Ia16af467d5f5bfca029002d9d261540947b0be92
Instead of using assertEqual(None, ***), developers should
use assertIsNone(***) to have more clear messages in case of failure.
Closes-Bug: #1510006
Change-Id: Ib3d09ed651877569a9b940da97662489885f18e9
Add bay filter to container, so that we can filter containers by bay_uuid.
Change-Id: Ie48757df37c1859211d775282cfcee82fe4fc9f8
Partially-Implements: blueprint filter-resource-by-bay
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particular order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit Tests
fail. There are several Unit Test files where the arguments for assertEqual
have been swapped.
Closes-Bug: #1259292
Change-Id: I17930c8ba8168baba9baddbdb7a54d54497f6a6d
Fix the failure to scale-down k8s cluster. We were getting this
failure because as part of scaling, Bay needs to be retrieved for
the respective k8s obj. But if the object passed is a Bay itself
we need not retrieve the Bay. At present even for Bay object the
code proceeds ahead to retrieve bay and cannot find bay_uuid
attribute. This patch fixes this problem.
We might need to backport this fix to stable/liberty as well.
Change-Id: I7ed03af8bdbb8647851751bb550d9529d96b5cb4
Closes-Bug: #1509439
Fix Wrong usage of bay object when create bay failed, stack_status should be
should from stack.
Closes-Bug: #1509236
Change-Id: Ieea0c990853d49876f4bbf850c8f6aaa6cef9683
K8s CLI especially pod/rc/service show and delete works with UUID. This
patch aims to fix k8s CLI to work with bay name as well. If needed this
patch will be ported back to stable/liberty as well.
Change-Id: I2fc9352af63cb261864be9332609603fb943a165
Closes-Bug: #1509091
Missing slash was added to Docker example and instruction how to
create kubectl configuration for certificates (to avoid type them for
each command)
Change-Id: I06fa04cea4df63fa03ea17598a33ce14685870e7
Reduce cyclomatic complexity of MagnumException to below 10. Remove
exception handling and optimise the logging when the kwargs does not
match the message.
Change-Id: I4fd6ba96be9dff485cdd8bde9750f2d584c1ec63
Closes-Bug: #1501331
The cyclomatic complexity of the setup method was greater than 10 and
reducing this complexity allows for easier understanding of the method.
Change-Id: I45d085d0943fd18a4207fc7a9ba64f2c0f8074ea
Partial-Bug: #1501331
The cyclomatic complexity of sync_bay_status was greater than 10 and
very hard to comprehend. This patch reduces the complexity and makes the
task more open to refactoring and maintence.
Partial-Bug: #1501331
Change-Id: If415aa7710b586b0429ed1bc5077976791b424d1
This is method is overly complex and should be broken down. When
reducing the max complexity allowed by flake8 this method was flagged.
Reducing the complexity of this method will allow better testing and
maintenance.
Partial-Bug: #1501331
Change-Id: Id0bdb2d03614ba31de0d96ed09c33695d933b9f7
This patch adds two files to .gitignore.
* `functional_creds.conf` is used for functional test
* `functional-tests.log` is generated by functional test
Change-Id: Ie21e8e20078770746117a8976444d9a72fd45d55
Closes-Bug: #1508797
To allow doc8 testing of the Magnum documentation in CI, doc8 should be
added to the pep8 tox command. After discussion with infra (see change
I6d42cb2092cbaed0cc2ed83f23b7f9ce0b52356f) this has been the suggested
method to allow for doc8 style checking.
As this behaviour is non-obvious I have left the doc8 command in the doc
tox env, this is not run by CI but will be run by users when modifying
and compiling documentation.
Change-Id: I93133e92d792ccc13d61f3ad1281007c2639853b
In I19c92dc9b4fe195037b5ad4ca49b529cf6be4cfb , we added proxy for k8s cluster,
but it is not working on k8s master since master doesn't have
/etc/systemd/system/docker.service.d/ which is diffenect from minion.
Beside, this patch also improves hardcode filename in add_proxy.sh.
Closes-Bug: #1508279
Change-Id: I03cd504276e9ca99625b93452f832de406cd1fb7
Co-authored-by: Madhuri Kumari <madhuri.kumari@intel.com>
This patch is meant to cleanup indentations in the templates, as
well some other house keeping fixes.
Closes-Bug: #1504685
Change-Id: I43f6cca8f449dea2db4de6a5308bfa5e4551838e
This patch adds proxy in follow places:
1. etcd needs ETCD_DISCOVERY_PROXY when try to do discovery
/etc/etcd/etcd.conf
2. docker daemon need set proxy to allow downloads images
/etc/systemd/system/docker.service.d/proxy.conf
3. and for os level, we need to set http_proxy, https_proxy and no_proxy too
/etc/bashrc
Implements: blueprint discovery-proxy
Co-authored-by: Manjeet Singh Bhatia <manjeet.s.bhatia@intel.com>
Change-Id: I19c92dc9b4fe195037b5ad4ca49b529cf6be4cfb