Commit Graph

623 Commits

Author SHA1 Message Date
Kendall Nelson 353f75eca0 Retire Karbor
As announced on the openstack-discuss ML[1], Karbor is retiring
this cycle (Wallaby).

This commit retires this repository as per the process defined in
the project-guide[2].

Thank you to all the contributors of Karbor for your hard work!

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-November/018643.html
[2] https://docs.openstack.org/project-team-guide/repository.html#retiring-a-repository

Depends-On: https://review.opendev.org/c/openstack/project-config/+/767030
Change-Id: I972ffb299f93863c4e34b1f504b002095661e6af
2020-12-21 11:51:02 -08:00
Zuul fcca3935af Merge "Switch legacy Zuul jobs to native Zuul v3 jobs" 2020-09-16 03:13:12 +00:00
Zuul 4bbc17595f Merge "Fix 'filter' object has no len ()" 2020-09-16 02:30:26 +00:00
Zuul 3881b44968 Merge "Fix inner has no attribute 'message'" 2020-09-16 02:08:41 +00:00
wangyu 594f4eff8a Switch legacy Zuul jobs to native Zuul v3 jobs
Replace the 'karbor-dsvm-fullstack' legacy Zuul job with
the 'karbor-fullstack' native Zuul v3 job.

See
https://governance.openstack.org/tc/goals/selected/victoria/native-zuulv3-jobs.html
for more details.

Change-Id: I558c8e02011e98950354266254511bd113d5c5ec
2020-09-15 10:09:41 +00:00
wangyu 5d6f5eb7ab Fix 'filter' object has no len ()
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
2020-08-15 11:44:53 +08:00
wangyu e167485dd7 Fix inner has no attribute 'message'
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
2020-08-14 10:28:51 +08:00
Sean McGinnis 3df667582c
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: Ifd0d1b8aa419e39361e76a4f846cb4eeaf0d46ca
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-08-13 08:28:07 -05:00
Andreas Jaeger 0764f5dab1 Update hacking for Python3
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
2020-05-13 19:20:28 +00:00
Zuul 297700ee2b Merge "Add unit tests for trigger update API" 2020-04-08 00:59:01 +00:00
Zuul 2ccd5da4a8 Merge "Remove password display for rabbitmq on connection log" 2020-04-08 00:57:33 +00:00
Zuul 1b50e6c117 Merge "Preserve request id in Karbor logs" 2020-04-08 00:54:21 +00:00
wangyu a0415ae7f5 Remove password display for rabbitmq on connection log
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
2020-03-26 08:42:38 +08:00
wangyu 435dc3c423 Preserve request id in Karbor logs
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
2020-03-26 08:28:00 +08:00
shenxindi 7fc2b10557 Remove unsupported calls
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
2020-03-16 17:30:28 +08:00
ericxiett 11ece54087 Add unit tests for trigger update API
Change-Id: I7f74c0346eef45ac83207410756e003266989bba
2019-12-13 02:17:32 +00:00
shenxindi 95c1a0e7e2 Fix unit test error
Fix all the order of decorators and parameters in unittest.

Change-Id: Ic055aaf38f1e99d21ca1ada3055048ee72a360d9
2019-11-15 10:52:24 +08:00
minruigao 5cbb6dcbc9 Add unit tests for quota_class_update api
Change-Id: I7a8a374f3978bc08a47c11b657252946339dd6b8
2019-11-14 11:28:03 +00:00
Zuul 848a246036 Merge "Fix get min interval error" 2019-11-14 10:54:06 +00:00
Zuul 960e737c9e Merge "Use trustee project_name instead of fixed value" 2019-11-14 10:43:43 +00:00
Zuul 5464d7240e Merge "Add unit test for services api" 2019-11-14 10:41:45 +00:00
Zuul 3676e53e1b Merge "Fix bug for running unittest with unittest module" 2019-11-14 10:38:56 +00:00
wangwei1 d56877b3fe Fix bug for running unittest with unittest module
When we run unittest with a way like:
python -m unittest2 <test_file>
then NoSuchOptError exception will raised

Change-Id: Ib0f9276c1b86ff7f2d1e401ddfae2bf4e920fa78
2019-11-14 17:02:49 +08:00
shenxindi d1052b68eb Fix unit test error
Fix the order of decorators and parameters for
karbor.protection.manager.ProtectionServiceTest in unittest.

Change-Id: I9d58c33787e0b2039a046ea30c7238485a76af2d
2019-11-14 16:58:24 +08:00
helei e482ebe18c Add unit test for services api
Change-Id: I0a4cec43c76d64191c5e962674ba31b5d6a834a3
Signed-off-by: helei <helei@cmss.chinamobile.com>
2019-11-14 15:30:41 +08:00
jiaopengju 66d007e501 Fix get min interval error
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
2019-11-14 06:28:22 +00:00
jiaopengju 82f07c14b6 Use trustee project_name instead of fixed value
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
2019-11-14 14:24:29 +08:00
jiaopengju 6093b5b11e Modify the time interval configurations in devstack
Story: 2006848
Task: 37436

Change-Id: I9ae08550f74347fc8f8436eca3cf4320ec97dd1f
2019-11-14 10:49:52 +08:00
jiaopengju 28fabef6ec Remove invalid exception catching
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
2019-11-12 16:04:12 +08:00
Zuul b3e8078b89 Merge "Add some operation log" 2019-11-11 07:20:31 +00:00
guolei 11ce26e484 Add some operation log
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>
2019-11-11 11:32:39 +08:00
liushuai 3ce0a84c36 Add unit test for triggers
Change-Id: I55995462f46d4cd7a135602bde92174edaf6b5a8
2019-11-07 23:24:45 +08:00
Zuul dabd25fc36 Merge "Correct spelling errors in test_quota_classes" 2019-11-06 04:54:39 +00:00
Zuul 26a0136c04 Merge "Add unit test for quota api" 2019-11-04 10:31:46 +00:00
Zuul b62d96aaf3 Merge "Optimize jsonschema validation when reset checkpoint state" 2019-11-03 12:07:20 +00:00
Zuul 08cef4fae6 Merge "Remove invalid none value judgment" 2019-11-01 01:22:45 +00:00
Zuul a3335ec621 Merge "Add trgger start and end time value check" 2019-11-01 01:16:19 +00:00
jiaopengju 07e72701ac Remove invalid none value judgment
volume will never be none here, so we can remove the none
value judgment and improve the code execution efficiency.

Change-Id: I5d35eebda6d4e9d8fd31a2e32cbcc68632afb2c8
2019-10-31 22:36:09 +08:00
jiaopengju f040c8a331 Add trgger start and end time value check
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
2019-10-31 22:14:40 +08:00
wangyu 4355859cf5 Optimize jsonschema validation when reset checkpoint state
Add 'os-resetState' validation when reset checkpoint state,
This patch will optimize parameter verification.

Change-Id: Id31955dbb44694790bb2192eeb247792c9e295f1
2019-10-22 17:40:19 +08:00
wangyu 798ba058ae Do not use 'self' in classmethod
'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
2019-09-29 16:21:10 +08:00
helei 5557c50c59 Add unit test for quota api
Change-Id: I5f4bbeced540df4fa002b273728833d98958ebc2
2019-09-18 21:59:27 -04:00
Zuul 8d3c3b5259 Merge "Replace use of log.warn with log.warning" 2019-09-16 08:21:00 +00:00
Zuul ef114e3f7a Merge "Remove the code which is unreachable" 2019-09-16 05:57:43 +00:00
jiaopengju 7fd5d54e2b Remove the code which is unreachable
Currently, in neutron_protection_plugin, some code is
unreachable and will never be executed. This patch will
remove them.

Change-Id: I3ce4517368fc82aac4eb81c801d6f81a8536e169
2019-09-16 11:09:36 +08:00
wangyu d8187d7e5f Replace use of log.warn with log.warning
LOG.warn is deprecated in Python3 and was used only here
in karbor, this patch updates it to LOG.warning.

Change-Id: Icad346bb6fd3efcac2f42fead1327585297f2f96
2019-09-16 02:24:50 +00:00
wangyu a3fcd6d6be Fix unit tests failed
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
2019-09-12 16:01:10 +08:00
jiaopengju 93c24b6f31 Using futurist to solve python3 issues
Change-Id: Ibc0beee562905ba93660116799b3f0eb5b7e7b8a
2019-09-08 12:26:24 +00:00
jiaopengju 487832ed13 Fix unit tests failed
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
2019-09-08 15:52:13 +08:00
hulina 7dfb09b147 Correct spelling errors in test_quota_classes
Change-Id: Ie35cc9150f654f2382336eeef23823eb9d766bd7
2019-08-20 10:46:54 +08:00