Karbor has a python3 compatibility issue where it will fail with:
TypeError: object of type 'filter' has no len(). 'filter' is a list
in python.
Change-Id: I6505e454e2073c1611cbe5c4887241253051b1f1
Closes-Bug: #1891732
When DBDeadlock in karbor-api service, it get the following error:
AttributeError: 'DBDeadlock' object has no attribute 'message'.
This patch corrects that problem.
Change-Id: I1b268f5cca2c4efdcfb055d2fd8dfe522e6daf9d
Closes-Bug: #1891571
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: Ifd0d1b8aa419e39361e76a4f846cb4eeaf0d46ca
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The repo is Python 3 now, so update hacking to version 3.0.1 which
supports Python 3.
Fix problems found.
Remove hacking and friends from lower-constraints, they are not needed
for installation.
Change-Id: I6691687f0cd2fe4c9e7f2a76d333ca9eacb0cbf3
When start karbor-protection and karbor-operationengine service,
Karbor will log rabbitmq password if debug is enabled. In a
production environment, this is pretty bad. This patch will fix it.
Change-Id: I11bd6db001739869fc6cddd005c9990d2943b809
Closes-Bug: #1859540
When the admin context is retrieved the user context and its request
ID is lost and all subsequent log entries have different request IDs.
The fix is to pass the overwrite parameter in Karbor's RequestContext
__init__ method to the parent oslo class.
Change-Id: I1091ddc8a36244132883932a3a21dea5274eb34a
Closes-Bug: #1859433
Because kubernetes 11.0.0 deleted the function of
'kubernetes.client.api_client.ApiClient.__del__',
which caused an ut error and deleted the relevant mock call.
Change-Id: I1ecade75227b3dc37c8fcdf775b7823583faea43
When we run unittest with a way like:
python -m unittest2 <test_file>
then NoSuchOptError exception will raised
Change-Id: Ib0f9276c1b86ff7f2d1e401ddfae2bf4e920fa78
Fix the order of decorators and parameters for
karbor.protection.manager.ProtectionServiceTest in unittest.
Change-Id: I9d58c33787e0b2039a046ea30c7238485a76af2d
When we use get_min_interval method, the exit condition is
the execution time is bigger than the rate time. But default
minutes rate is 2, this may leads errors when the interval
is bigger than 2 minutes, it always return None. So we can
not use min interval to judge if the interval is smaller than
that we configured in the configuration file. This should be
fixed.
Story: 2006848
Task: 37436
Change-Id: I268051f05f9b89e1b6013cfc8cecf90e9dc78581
Currently, when the default project name for openstack
services is not "service", it will fail when listing
protectable resources. This patch using trustee.project_name
to replace it.
Story: 2006797
Task: 37343
Change-Id: I8be62bb00e70dacd174e7fa3bd65489fb63488ab
List operation of verifications will never raise VerificationNotFound
exception in _get_all method, we should remove it to normalize the
error code.
Change-Id: Ia1a6345b1e38b9ccc4246d2d39d11cc8e537cb4e
For protect operation and retention operation, lacks some
key operation log print, so we add it.
Change-Id: Ife73b29511de3eea5094732fcfc82ff5e9783bc2
Signed-off-by: guolei <guolei@cmss.chinamobile.com>
volume will never be none here, so we can remove the none
value judgment and improve the code execution efficiency.
Change-Id: I5d35eebda6d4e9d8fd31a2e32cbcc68632afb2c8
Currently, karbor do not check start time and end
time value, so the end time may be early than start
time. This patch will fix it.
Story: 2006402
Task: 36284
Change-Id: If8909c9abd6fdcd7ce2e85a61472a8dc43f6fe51
Add 'os-resetState' validation when reset checkpoint state,
This patch will optimize parameter verification.
Change-Id: Id31955dbb44694790bb2192eeb247792c9e295f1
'cls' should be used in classmethd, instead of 'self'.
This patch corrects this in the following places:
- karbor/services/protection/checkpoint.py
- karbor/services/protection/protection_plugins/network/neutron_protection_plugin.py
Change-Id: I70c5ae7d3ea79ef5868a222509e583d510d8607c
Currently, in neutron_protection_plugin, some code is
unreachable and will never be executed. This patch will
remove them.
Change-Id: I3ce4517368fc82aac4eb81c801d6f81a8536e169
LOG.warn is deprecated in Python3 and was used only here
in karbor, this patch updates it to LOG.warning.
Change-Id: Icad346bb6fd3efcac2f42fead1327585297f2f96
if flow is None for add_tasks when running unit tests,
the method 'add' for flow will be failed. this patch
will fix it.
Change-Id: I1bd70cea69cc54bea34de4b655f6d7caecfdf0e2
Currently, zuul test job always failed, it is because the
attribute in SessionClient of nova client has been removed
and use endpoint_override instead, this patch will fix it.
Change-Id: I3101d829ee4382d95acbdc6b756de2b8619b254f