Commit Graph

18 Commits

Author SHA1 Message Date
Rajesh Tailor 67d9c3cc28 Fix typo in code
This change fixes typo from 'resouce_classes' to
'resource_classes' in delete api call.

Also adds missing dependency for webtest library.

Change-Id: If5135a67187deccec0834f2b2af5dc38f7c5a909
2022-08-07 21:42:24 +05:30
Yumeng Bao 01e9a74505 [goal] Fixing lower constraints for Ubuntu Focal
As per victoria cycle testing runtime and community goal[1],
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Bump lower constraints to make testing work for Focal.

[1]https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal

Change-Id: I57537f1afaac87cb99d2cae4e150f915428135e0
Story: 2007865
Task: 40181
2020-09-17 16:30:12 +08:00
zhangbailin 6b0e1f8d12 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. Most of this
is autogenerated, as described below, but there are three manual changes
necessary.

Change-Id: If9cd7eca3454d9e1d62a0a1753e157adbf965e8d
2020-06-16 07:24:42 +00:00
Ghanshyam Mann 4c941dbc81 Fix hacking min version to 3.0.1
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.

Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.

To avoid similar gate break in future, we need to bump the hacking min
version.

- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html

Change-Id: Ia12b837b81faec9288bb649c4d544f7eadf5c8b3
2020-05-13 02:59:19 +00:00
Andreas Jaeger a6f84335bb Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found:
E117 over-indented
E501 line too long
E741 ambiguous variable name 'l'
W605 invalid escape sequence

Blacklist:
W503 line break before binary operator
W504 line break after binary operator

Update local hacking checks for new flake8.

Change-Id: I5d11a1f87d9547d9b6a27bf1f79cd69e0f73c741
2020-03-30 16:18:12 +02:00
chenke 4bf582a849 Use ResourceNotFound replace RP and Image NotFound
This is a series of optimization for exception.

In fact, we only need to use the ResourceNotFound exception
to fit NotFound Exception.

This patch also adds dependency package cursive which is used
in [1].

[1]. 6740c3c0c5/cyborg/image/glance.py (L30)

Change-Id: I9e80dcfed54147c942f90c696e483fa6db842dde
Story: 2007045
Task: 37968
2020-01-17 09:08:22 +00:00
Yumeng Bao d765a344ee Introduce bandit security linter
Cyborg now does not have a code security check, which may connive at
possible security issues. For example, shell-related operations for drivers
may be insecure. Current "sudo lspci -nnn -D" in huawei ascend driver code[0]
is insecure, but there is no any job/test that can check the potential security
issues. So this patch introduces bandit as a code security check.

[0]:https://github.com/openstack/cyborg/blob/master/cyborg/accelerator/drivers/aichip/huawei/ascend.py#L69

Change-Id: Ia1f9acbbd176180cb5fe97b1a2eee5f98a95dea6
2020-01-05 19:49:22 -08:00
Yumeng Bao 914a9446ea Replace pycodestyle with pep8 for python3 compatible
when runnig "ostestr cyborg.tests.unit.common.test_nova_client" under
py36, there throws the following error:
Failed to import test module: cyborg.tests.unit.test_hacking
  File "cyborg/tests/unit/test_hacking.py", line 18, in <module>
    import pep8
ImportError: No module named pep8

This is because pep8 doesn't exist any more in python3, pycodestyle is
the substitute.

Change-Id: Ia5bfa1f341606fc42b7a37a5fee9b426c59a05c2
2019-12-10 01:39:43 -08:00
Xinran WANG 07efd624b8 Placement report
1. Create resource provider, resource class, traits.
2. Nested resource provider is supported in this patch.
3. According to the comments and reply in:
https://review.opendev.org/#/c/626057/10/cyborg/common/placement_client.py,
we should make a class to invoke Placement API. This has also been done in
this patch.
4. Convert cyborg/objects/driver_objects/driver_device.py file type from dos to
unix, to avoid ^M at the end of each line.
5. Get rid of legacy: ProviderTree class.
6. More info for driver developers:  each driver should report resource class
and traits in driver_attribute field in order that cyborg-conductor can parse
it and report to placement.
7. update deployable rp_uuid field after getting rp_uuid from placement.

Change-Id: Ib8f682255d2ae60eb615c90de0a0f7c83d1af54d
2019-09-04 08:43:28 +00:00
Yumeng Bao 33b86b8631 Follow the new PTI for document build
In order to follow the new PTI for doc build, this patch:
1)removes unused build_sphinx in setup.cfg
2)move doc dependencies from test-requirements.txt to doc/requirements.txt
3)update tox.ini

For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html

For more details information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: Ic700f04b857516ce5b25ce5e0fc431d1f08e24f3
2018-08-11 12:55:49 +08:00
Yumeng Bao 3cb5c38edb Docs: Autogenerate config documentation
Ensure the documentation is kept up to date by automatically
generating it from the source when the docs are built.

This patch:
1.replace oslosphinx with openstackdocstheme since oslosphinx is obsolete
2.add oslo_config.sphinxconfiggen to generate sample conf file
3.add oslo_policy.sphinxpolicygen to generate sample policy file

Change-Id: I39f03023f0a85e4c8943925268ab3e9066975630
2018-08-08 01:26:38 +00:00
Vu Cong Tuan e76f2a5f90 Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I8b0f96f05799b892acfae03522726c17010f0df3
2018-07-24 15:10:52 +07:00
Nguyen Van Trung 38c1618e60 Add doc8 to pep8 check for cyborg project
This patch adds a doc8 check of .rst files to the current pep8 check.
It includes fixes to the .rst files that didn't pass the check.

Change-Id: Ib7a63d1e579f77039172aa4f99d26a3ceeef83d7
2018-05-10 09:32:01 +07:00
Doug Hellmann 305c320dcb uncap eventlet
We will manage the eventlet version using constraints now. See the
thread starting at
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129096.html
for more details.

Change-Id: I3c4282f0bc2ddedf816f366cd058823777ecdab9
Co-Authored-By: Michel Peterson <michel@redhat.com>
2018-05-07 17:42:19 +03:00
Nguyen Van Trung 7d9524c7b3 Cleanup test-requirements
python-subunit is not used directly anywhere
and it is dependency of both testrepository
and os-testr.

Change-Id: I2136b810c2c304064dfd5dbe178a4c53b8860020
2017-11-06 14:38:14 +07:00
zhuli 2a71b8efe6 add api unit test
add api unit test to validate the accelerator_post function.

1. load a test app for pecan framework test
2. mock out the accelerator_create function in Conductor RPCAPI
3. post test request to '/accelerators' endpoint
4. do the check between request and response

Change-Id: I5d565d0d7ed56c27555666e52e34f5fd67005dcf
2017-09-14 13:56:59 +08:00
zhipengh 43e717bd9e Rename old Nomad files to Cyborg
Replace nomad with cyborg in the skeleton, also update
test-requirement.txt

Change-Id: I2b3f54f2591facc6bab7ab8f41fb8c9919b01845
2017-02-05 22:31:28 +08:00
zhipengh 84fc02aedb initial setup "correct tox.ini testr and test-requirement.txt requirement
, add .testr.cof"

Change-Id: I5abe3fe60897e22edefaf226f9431d5ade2797e1
2016-01-18 14:29:39 +08:00