Commit Graph

339 Commits

Author SHA1 Message Date
Cai Hui 29dd109cbc Delete the func of build_app_v0()
The func of def build_app_v0 is not used any more.
Delete it.

Change-Id: I1d26cfc2f398cbf219adf59e2582096cb0600e73
2021-11-06 18:38:20 +08:00
Cai Hui 8e67288166 Remove unuseful func
Remove unuseful func and fix unit test error.

Change-Id: Ibf2a60ac110a95e4cccdc73d9edb7522d6c7b43b
2021-11-02 21:51:09 +08:00
caihui 22d20337a8 Fix the error for the module of falcon
File "/home/zuul/src/opendev.org/openstack/freezer-api/freezer_api/common/exceptions.py", line 73, in handle
    status=falcon.status.HTTP_404,

    AttributeError: module 'falcon' has no attribute 'status'

Change-Id: I3b77a5a3799f066ef189862e75de24b4c25c0569
2021-06-10 14:56:31 +08:00
Ghanshyam Mann e02a492817 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I066488c47e1bb6502b27b8677988113f66b9b09b
2021-03-08 19:52:30 -06:00
Zuul d971f29f28 Merge "remove unicode from code" 2021-02-03 03:57:03 +00:00
gecong1973 719a3feb60 Fix a bug when unit test use the local conf O
AttributeError: 'Connection' object has no attribute 'iterdump'

Change-Id: I1bca4617d6d57dd6d62e38b11a109dc87cc6bfcd
2021-01-27 18:14:17 -08:00
caihui 34641efcf5 Fix pylint error
Use pylint = 2.6.0 , fix some errors.

Change-Id: I1fdb40c7a8ac986332e10b642ab86799fc5ff78d
2021-01-24 17:55:32 -08:00
liyou01 9ce1a11451 remove unicode from code
Change-Id: Ie452dbdd42ec7ef34993572ac0b456562aabab79
2021-01-07 14:37:16 +08:00
gecong1973 58ca4675ab Fix a bug for api
Change-Id: I6b79d1e283dd043bf9650e29eb848244fadeb1e1
2020-09-29 06:44:45 +00:00
Luigi Toscano 80de329bd8 Fix a few mock imports still not from unittests
Change-Id: Idde9a450e9ac4ffe786f5233ef22eacd7df6b8eb
2020-08-11 14:29:09 +02:00
Hervé Beraud 355c68fb94 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I2728250b2646af93c65ac7f18dbf7600fe5a286c
2020-06-02 20:13:25 +02:00
Andreas Jaeger 11a19f2ea8 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Remove hacking and friends from lower-constraints, they are not needed
for installation.

Change-Id: Ibc3b00aca7332f12b58893213acfc88749b74aa1
2020-04-14 20:09:03 +02:00
jacky06 114f91f39c 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: I749d6ebdef9163ffa3135778a4accbb8be5ba9e3
2020-04-10 22:03:44 +08:00
Michal Arbet 2a283bf34a Fix freezer-api's src_file to path_to_backup
Freezer-api is not working as it is expected, returning NULL value
for src_file option in freezer_action's json returned from API.

In other words when user define action via freezer client and define
valid and WORKING action JSON with option path_to_backup
(src_file is not supported by freezer-agent anymore).

In DB we can see backup_metadata is filled correctly,
freezer-scheduler/freezer-agent working correctly as they are reading
backup_metadata. Problem is that API is still returning json with
src_file set tu NULL because src_file is not present in backup_metada,
therefore is not filled in src_file column in action table.

Src_file option was changed to path_to_backup in freezer git repository
below, but API was never changed, this patch is fixing this behaviour.

Freezer's change :
c7f71ff70b

Doc changes in freezer:
https://review.opendev.org/#/c/705003/

Change-Id: I9e74910bd0ff4ad18b830c26ce90770b0dfa107b
2020-01-31 11:45:39 +01:00
caihui 729bcfaf6b Remove six usage from freezer_api package
We don't support Python 2 anymore so we don't need this
compatibility library.
Convert six usage to Python3 code.

Change-Id: Iadf47e805c8d0dd32239456e69d8fdc78f77f30d
2020-01-22 02:14:39 -08:00
lu-meihong 886b6fb7da modify comments
Change-Id: I512337b054cf0708ba483c1651517cc5f0cfd3ce
2019-10-18 00:08:39 -07:00
Zuul e4e7f01e6f Merge "Remove code that supports older version falcon" 2019-06-01 11:26:22 +00:00
Zuul 33fa18a87b Merge "Fix ci fail due to falcon for sessions" 2019-05-31 06:34:58 +00:00
Zuul 38effd98a5 Merge "Fix ci fail of tempest for V2 action and job table" 2019-05-31 06:34:57 +00:00
Zuul fa68231054 Merge "Fix ci fail of tempest for V2 clients" 2019-05-31 06:24:45 +00:00
Zuul 60aed3c85a Merge "Fix ci fail of tempest for V2 backup table" 2019-05-31 06:23:23 +00:00
Zuul 22b9b3c5e8 Merge "Fix ci fail due to falcon for jobs and backups in v1" 2019-05-31 06:22:58 +00:00
Zuul ef69e71a65 Merge "Fix ci fail due to falcon for clients and actions in v1" 2019-05-31 06:21:27 +00:00
Zuul 25e80f6568 Merge "Add a param req_succeeded for falcon: process_response" 2019-05-31 06:11:28 +00:00
gengchc2 3fc0cc9a1e Add a param req_succeeded for falcon: process_response
In falcon 2.0.0, process_response is changed as follows:
  def process_response(self, req, resp, resource, req_succeeded)
In falcon 1.4.1, process_response is changed as follows:
  def process_response(self, req, resp, resource)

Change-Id: I737ec903f22d310b8335ad47505045b6a1ecc667
2019-05-31 03:34:40 +00:00
gengchc2 24ebe1ffd7 Update handling for falcon 2.0.0 behavior changes
The 2.0.0 release of falcon changed the default values for two request
query parsing options that would cause failures due to unexpected
results. This sets those options to their previous defaults to maintain
compatibility across 2.0.0 and pre-2.0.0 versions of the package.
Lower constraint version raised to 1.1.0 where the options were
introduced.

There are additional integration test failures with Falcon 2.0.0 that
were due to changes in the subscription URL path.

Change-Id: I4aa18510cc11827c2ef478bf4ca6bd1baa9878e4
2019-05-31 03:34:22 +00:00
gecong1973 ccda874796 Fix ci fail due to falcon for sessions
Fix ci fail due to falcon upgrade

Change-Id: I58b7ffc3deddc573bdea0711a21921ca7f5d3d28
2019-05-31 03:34:04 +00:00
gecong1973 6a92a95cf3 Fix ci fail of tempest for V2 backup table
The patch fix the fail of tempset

Change-Id: Ia002576a9f63c7bcc787364c0b89dcbd493614bf
2019-05-31 03:32:48 +00:00
gengchc2 fb8dd50bcb Fix ci fail due to falcon for jobs and backups in v1
Fix ci fail due to falcon upgrade.

Change-Id: I2ff66360ddd65cc34ac586277995e62c9078b413
2019-05-31 03:32:38 +00:00
gecong1973 b965ab39a8 Fix ci fail of tempest for V2 action and job table
The patch fix the fail of tempset

Change-Id: Iba6a866d4a99b222b0e45882c55a25eb796be254
2019-05-31 03:32:29 +00:00
gecong1973 a60c2934b3 Fix ci fail of tempest for V2 clients
The patch fix the fail of tempset

Change-Id: I9853c77749c565928287c906a127341273896077
2019-05-31 03:32:19 +00:00
gengchc2 e4c8abd903 Fix ci fail due to falcon for clients and actions in v1
Fix ci fail due to falcon upgrade

Change-Id: I0e5ba4a66e0ee4e85ea2d0b79bac6c5e2954b1e1
2019-05-31 03:32:01 +00:00
Cai Hui f94229aead Remove code that supports older version falcon
In the requierment.txt, falcon version is required to be greater than 1.0 ("falcon>=1.0"),
So remove code that supports older version falcon.

Change-Id: I803397a6b0f0269d1548718aa8826f0a73521405
2019-05-24 05:16:27 -04:00
gecong1973 b52291b7e6 Modify mode field in action table for sqlite
The mode field is reserved word in sqlite, the patch
change it to actionmode

Change-Id: Ia9ad6e312562c260424134251600b6d100182ac0
2019-03-28 17:59:22 -07:00
zhulingjie a350b44b1b Update json module to jsonutils
oslo project provide jsonutils, and the others project use it now,
this PS to update json moudule to oslo jsonutils for consistency.

Change-Id: Ifbf7b16e7c81dc0f85b07b77599ab4e404f2cdd4
2019-02-21 11:00:54 +00:00
gengchc2 5e60886b08 Fix session_tag type in job table
Change-Id: I5ba130cb7c54c4999ec8985d90c567336b8c4a68
2019-02-14 18:03:29 -08:00
gengchc2 857c239e97 Remove redundant code and improve test coverage
storage/driver.py is redundant file
get_opts in elasticsearchv2.py is redundant

Change-Id: I2c6d892016508c21fbc782d1628136618342c21f
2019-01-08 05:29:23 +00:00
gengchc2 df5cca26bb Delete invalid codes and Add a unit test for elastic
1.In _validate_opts:
The following code is True forever, We will delete it.
2. Add unit test for ca_certs in _validate_opts.

Change-Id: I25a9a4aaae6fd5677d07d376f66188dc0b92bc3b
2018-12-28 22:07:28 -08:00
gengchc2 edb258dbb6 Add raise unit test for search tuple in sqlalchemy
Change-Id: I60a2305b97f73b011496a8c02e115ab339d130f9
2018-12-26 16:53:57 -08:00
gengchc2 0f7c37c776 Add unit test for action_manager and session_manager
Change-Id: Icbd505f50d882078df1e2f26bc539cd52c111d5c
2018-12-26 16:47:35 -08:00
gengchc2 81198a782a Add raise unit test for update and replace tuple in sqlalchemy
Change-Id: I6f244639954db856f713e08f7c3dfdb2618f4ecd
2018-12-25 01:15:06 -08:00
gengchc2 0e3a3d366b Add unit test for TypeManager and TypeManagerV2
Change-Id: I48923a340860b153ccea981e9974366b95dadf9c
2018-12-25 01:00:55 -08:00
gengchc2 1977c7e9d3 Add raise unit test for get and add tuple in sqlalchemy
Change-Id: I8c9f05a370c42fe4b547b45b53535dbb51bb9cd6
2018-12-24 18:45:28 -08:00
gengchc2 4326fd75ba Add unit test for client_manager and job_manager
Change-Id: I20ba07e88b4ca7737b72a8ec86186f72075bf625
2018-12-24 18:10:17 -08:00
Zuul c0c1232ac0 Merge "Add unit test for ElasticSearchEngineV2 and backup_manager" 2018-12-24 09:45:45 +00:00
Zuul c13150dd28 Merge "Add api unit test for model_query in sqlalchemy" 2018-12-24 08:15:54 +00:00
gengchc2 bf78dbece6 Add unit test for ElasticSearchEngineV2 and backup_manager
Change-Id: Ib6287eca52d77f99358ed5500090e84dc77a6f86
2018-12-23 23:09:08 -08:00
gengchc2 cd8f7e9f4e Add api unit test for model_query in sqlalchemy
Change-Id: I51f3cd70f29b89586d6001106d29b393bac08c9e
2018-12-23 22:29:03 -08:00
gengchc2 02decd342d Add raise unit test for action and backup in sqlalchemy
Change-Id: I3f0feeea92cc7ba97e9952ced3a56fd96abb03b2
2018-12-24 05:43:47 +00:00
gengchc2 d41f3ab696 Add raise unit test for job and backup in sqlalchemy
Change-Id: I7e22e6a3ac53eee6ab653a62be21829a42162623
2018-12-21 07:22:27 +00:00