Commit Graph

150 Commits

Author SHA1 Message Date
Riccardo Pittau 69635a1597 Move back to plain pyasn1
The latest pyasn1-lextudio patch has been yanked [1] and
all the working versions have been removed from pypi, it
looks like lextudio won't maintain pyasn1 anymore.
We should move back again to plain pyasn1 [2].

Also bump proliantutils min required version as it
has already switched back to working pyasn1 and pysnmp.

[1] https://pypi.org/project/pyasn1-lextudio/
[2] https://pypi.org/project/pyasn1/

Change-Id: Id2e7f75690c42fe0785b4ab0fb0a885261a44aef
2024-03-14 14:40:17 +01:00
Riccardo Pittau c8c83ef544 Migrate to pysnmp lextudio ecosystem
The pysnmp library is not maintained since 4 years now and it's
incompatible with recent libraries like pyasn1.
Its fork pysnmp-lextudio is regularly maintained, we should move
to that.

Change-Id: I3b7b5c0cf2f7d669b265669d27e0eaca0dd1fc2a
2023-05-11 08:52:52 +02:00
Riccardo Pittau d26e0d2b7b Bump min version of testtools
Any version of testtools lower than 2.5.0 fails if the
attribute 'result_supports_subtests' is present on any
test object because of old unittest support.

See also https://github.com/testing-cabal/testtools/issues/235
and 38fc9a9e30
for more info.

Change-Id: I23a1ca789f4ea4ffd981e1071f3c2c6c333ac330
2022-10-13 09:03:24 +02:00
Riccardo Pittau 06124bae73 Update requirements
Update minimum required versions of python packages.
The updates is based on crosscheck requirements from required
packages:
oslo-log 4.3.0 depends on oslo.context>=2.20.0
oslo-config 6.8.0 depends on rfc3986>=1.2.0
oslo-config 6.8.0 depends on requests>=2.18.0
oslo-log 4.3.0 depends on pbr>=3.1.1
oslo-log 4.3.0 depends on oslo.serialization>=2.25.0
oslo-policy 3.7.0 depends on oslo.context>=2.22.0

Also update minimum versions of ddt and stestr to avoid compatibility
issues with recent Python versions (3.8 and higher).

Change-Id: I34b558f4e7b93618130af1ba2250f6ab8575d4d6
2021-07-13 14:37:28 +02:00
Iury Gregory Melo Ferreira 98732623b2 Fix lower-constraints with the new pip resolver
* move pep8 dependencies from test-requirements to tox.ini,
  they're not needed there and are hard to constraint properly.
* add oslo.cache to l-c to avoid bump of dependencies

Change-Id: Ia5330f3d5778ee62811da081c28a16965e512b55
2020-12-11 13:34:24 -08:00
Riccardo Pittau b0b8435bf8 Update test requirements
And fix a little pep8 issue (missing blank line).

Change-Id: I9d7809a5d1dc956d798c41af29054e5d9cd0b9cf
2020-10-15 16:00:47 +02:00
Yushiro FURUKAWA 0e399f750a Fix handling OctetString for pysnmp
This commit fixes getting MAC address while inspection for iRMC driver.
To remove ord() in retrieving MAC address, it can avoid the following
exception:

  TypeError: ord() expected string of length 1, but int found

Also, this commit sets the following type of mock for UT. So, I add
'pysnmp'[1] into test-requirements.txt and lower-constraints.txt.

  * pysnmp.proto.rfc1902.OctetString
  * pysnmp.proto.rfc1902.Integer32

[1] https://bit.ly/3bDeTCH
Change-Id: I1e013a93854e01a7060e1fc48aac091e7e9b74cb
2020-09-29 13:00:52 +00:00
Iury Gregory Melo Ferreira 19d97e6562 Fix lower-constraints for Ubuntu Focal
Change-Id: Id3cc2d1b619790813b94b0cfd52ff6590aff060c
2020-09-11 04:23:12 +00:00
zhangbailin 296c8669a9 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: Idb45c6b09980c6850b1acf05a03c9be59fb254bc
2020-06-30 23:58:56 +00:00
Ghanshyam Mann 774bc9264b Cap pycodestyle explicitly to be < 2.6.0
The 2.6.0 version introduces some checks that cause failures
with the current code. hacking and flake8 cap could have solve
the pycodestyle compatible version but flake8-import-order which
does not cap the pycodestyle pulled its latest version and break
things.

Also remove the flake8 from test-requirements and let hacking
handle the flake8 version otherwise ironic will still pull the
latest flake8 which can break things in future.

To make it work, we need to explicitly cap pycodestyle itself
so that no other package pull the new checks in.

Change-Id: Ia4b6f5aa8fe45d08a1563160e585947f35501ef2
2020-05-12 20:52:40 +00:00
Zuul a97c95364f Merge "Temporary add per-file-ignores to flake8 tests" 2020-05-08 05:03:07 +00:00
Riccardo Pittau 6c8579c0d1 Temporary add per-file-ignores to flake8 tests
This should help slowly enabling H210 test everywhere.

Also fixing H210 enforced autospec in some places.

Change-Id: Ibbc00b528265f8b86bc2fe45e078d56d36381c5d
2020-05-06 16:24:55 +02:00
Dmitry Tantsur ce878131cd Remove testscenarios, testrepository and Babel from test-requirements
Neither of these are really used. They have likely been cargo-culted.

Also removing mock from doc/requirements, not sure how it got there.

Change-Id: I8d242d86af4c6ded215e0bc4cf61da346f21e46c
2020-05-05 11:01:59 +02:00
Iury Gregory Melo Ferreira d6e7552457 Switch to unittest mock
Python3 have a standard library for mock in the unittest module,
let's drop the mock requirement and switch tests to unittest mock.

Change-Id: I4f1b3e25c8adbc24cdda51c73da3b66967f7ef23
2020-04-30 19:04:17 +02:00
Riccardo Pittau 805e004e9c Upgrade flake8-import-order version to 0.17.1
Full py3 compatible version.
Add all Python3 modules to stdlib list.
Also includes fix to an enum34 dependency bug.

Change-Id: I6163317368ed9281ad600f47aaa64cbcf44d9a13
2020-04-21 15:06:33 +02:00
Kaifeng Wang dcc049768b Fixes unusable Guru meditation report
GMR requires configuring a path for storing the report via [oslo_reports]log_dir,
this is empty by default, and currently there is no means to specify this option,
thus doesn't respond with SIGUSR2.

Though gmr is optional, test requirement is still required so that we can
generate proper configuration sample for it.

Story: 2007570
Task: 39467

Change-Id: I0f03e9d01a3c4e42a4fc8bf2d8ceb2d1a587056c
2020-04-20 09:00:03 +08:00
Dmitry Tantsur a3d7d73a69 Bump hacking to 3.0.0
The new version enables a lot of standard flake8 checks. Some of them
are temporary disabled to reduce the scope of this patch:
* Complexity check requires a few functions to be rewritten (apparently,
  it was not enabled previously).
* Indentation check failures are numerous and potentially contradictive.
These checks will be enabled in follow-ups.

W606 is removed from excludes since we no longer hit it.

Change-Id: I1e5a6f8e5e90c55cfc6f740b26c30196512d3be3
2020-03-31 10:16:54 +02:00
Surya Seetharaman d693d4c06c Support power state change callbacks to nova using ksa_adapter
Add power state change callbacks of an instance to nova by
performing API requests. Whenever there is a change in the
power state of a physical instance (example a "power on"
or "power off" IPMI command is issued or the periodic
``_sync_power_states`` task detects a change in power state)
ironic will create and send a ``power-update`` external event
to nova using which nova will update the power state of the
instance in its database. By conveying the power state changes
to nova, ironic becomes the source of truth thus preventing
nova from forcing wrong power states on the instance during
the nova-ironic periodic sync. It also adds the possibility of
bringing up/down a physical instance through the ironic API
even if it was put down/up through the nova API.

Note that ironic only sends requests to nova if the target
power state is either "power on" or "power off". Other error
states will be ignored. In cases where the power state change
is originally coming from nova, the event will still be
created and sent to nova and on the nova side it will be a
no-op with a debug log saying the node is already powering on/off.

NOTE: Although an exclusive lock (task_manager.upgrade_lock()
method) is used when calling the nova API to send events,
there can still be a race condition if the nova-ironic power sync
happens to happen a nano-second before the power state change
event is received from ironic in which case the nova state will
be forced on the node.

Credit for introducing ksa adapter: Eric Fried <openstack@fried.cc>
Depends-On: https://review.opendev.org/#/c/645611/
Part of blueprint nova-support-instance-power-update
Story: 2004969
Task: 29424

Change-Id: I6d105524e1645d9a40dfeae2850c33cf2d110826
2019-08-12 19:29:57 +02:00
Zuul adecc670f7 Merge "Incorporate bandit support in CI" 2019-06-19 05:45:10 +00:00
Kaifeng Wang caf925349a Incorporate bandit support in CI
Change-Id: I0ffe0c12e9e32f32d2b400b5756fc2148a2993a0
Story: 2005791
Task: 33518
2019-06-10 09:26:04 +08:00
Ilya Etingof 234dea98bb Bump lower mock version to 3.0.0
Previously used mock 2.0.0 has a nasty bug which prevents mocking
`@staticmethod` callables [1][2].

1. https://github.com/testing-cabal/mock/blob/master/CHANGELOG.rst#300
2. https://bugs.python.org/issue23078

Change-Id: I38d78cb8de92e9ecfc3dda5ffafcb4ffe175169e
2019-06-04 17:05:01 +02:00
Kaifeng Wang 2eceb3c8ab Fix lower-constraints job
lower-constraints job is broken due to fail to install psycopg.

Spotted log:

http://logs.openstack.org/02/642402/6/check/openstack-tox-lower-constraints/ca317fe/job-output.txt.gz#_2019-03-14_01_51_01_006156

Add libpq-dev to the bindep and bump psycopg version to >= 2.7 as evidence
shows it has a bug to support PostgreSQL >= 10.0 [1]

[1] https://github.com/getredash/redash/pull/2111

Change-Id: I1d5f0dab41638be1df9d63ede267f5a6d9f8c566
2019-03-14 17:24:09 +08:00
Nguyen Van Trung de6cfdb541 Fix stestr has no lower bound in test-requirements
This issue will occurs when they validate with test-requirements in
constraints.

issue logs:
  | ubuntu-xenial | Validating test-requirements.txt
  | ubuntu-xenial | Requirement for package stestr has no lower bound

Change-Id: I61a25bc6ccbc97006443db8f9086bec41506e940
2018-06-18 09:23:02 +07:00
Pavlo Shchelokovskyy 64a90a6700 Comply with PTI for Python testing
Project Testing Interface for Python [0] suggests to use stestr
as unit test runner uniformly across all OpenStack projects.

[0] https://governance.openstack.org/tc/reference/pti/python.html

Change-Id: I1c321500a2256b09cb6a58f6cd7070c9dc702555
2018-06-07 10:39:16 +03:00
Dao Cong Tien 580d4338e2 Check pep8 without ignoring D000
Currently, ironic ignores D000 check because of error:
"D000 Cannot analyze code. Pygments package not found."

Pygments is supported from:
https://review.openstack.org/#/c/568729/

Change-Id: Ib942f47abf6facaf9967603914326aa3cb79bbd9
2018-05-24 08:33:56 +07:00
ghanshyam 3f460ba927 Gate fix: Cap hacking to avoid gate failure
hacking is not capped in g-r and it is in
blacklist for requirement as hacking new version
can break the gate jobs.

Hacking can break gate jobs because of various
reasons:
- There might be new rule addition in hacking
- Some rules becomes default from non-default
- Updates in pycodestyle etc

That was the main reason it was not added in g-r
auto sync also. Most of the project maintained the
compatible and cap the hacking version in
test-requirements.txt and update to new version when
project is ready. Bumping new version might need code
fix also on project side depends on what new in that
version.

If project does not have cap the hacking version then,
there is possibility of gate failure whenever new hacking
version is released by QA team.

Example of such failure in recent release of hacking 1.1.0
- http://lists.openstack.org/pipermail/openstack-dev/2018-May/130282.html

Change-Id: I688a5f322bba52ae3b9fa5ecab5bed4f58fec542
2018-05-09 02:43:42 +00:00
John L. Villalovos ca91d4d871 Remove pycodestyle version pin. Add E402 and W503 to ignore.
Rather than pinning pycodestyle, ignore the E402 and W503 error. Fix
issue with E731 (Do not assign a lambda expression, use a def).

W503 is something we will likely never enable as it is a personal
style decision and can change depending on the code. There is no one
right answer. Interestingly there is also a W504 which is the opposite
check.

E402 is one we should most likely fix. But it can be done in a follow
patch or patches.

List of various error codes:
https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes

Change-Id: Ie2c31a8a3c75beeef22453cab5878cf0094bdf3f
2018-04-10 16:48:26 -07:00
Jim Rollenhagen fc15be6e32 Pin pycodestyle to <=2.3.1
2.4.0 broke our pep8 tests pretty hard:
http://logs.openstack.org/20/531320/14/check/openstack-tox-pep8/c9d9d10/job-output.txt.gz#_2018-04-10_15_43_40_014738

Pin pycodestyle until we have time to fix all of those.

Note that this is in the global-requirements blacklist to allow
projects to manage those versions on their own:
b94a4e8c8f/blacklist.txt (L13)

Change-Id: I6b0d458c702684779eb21e7022dd0f3193ac72d2
Story: 2001819
2018-04-10 21:23:46 +00:00
Nguyen Hai 7ba42e091d Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
[1] https://governance.openstack.org/tc/reference/project-testing-interface.html
[2] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

[doc/requirements.txt] & [test-requirements.txt]
To support documentation generation in new PTI, project should have
list python dependencies needed for documentation in
doc/requirements.txt which are move from test-requirements.txt

[doc/source/contributor/index.rst] & [setup.cfg]
- Remove [pbr] section in setup.cfg [3], and unrelated lines in
contributor/index.rst
[3] http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html
- Add sphinxcontrib.apidoc to replace pbr autodoc

[tox.ini]
--ignore D000: pep8 require sphinx (which move to doc/requirements.txt)
to test doc/source files, however, docs already test the doc/source.
Therefore we can ignore the D000 error code.

Depends-On: https://review.openstack.org/#/c/559327/
Change-Id: Iee90f19a5e46978a97035eab7e4b1e0ec68b8684
2018-04-06 14:33:47 +00:00
OpenStack Proposal Bot 30a557ff07 Updated from global requirements
Change-Id: I4c7930477e058a09ad90c8697b8f4b5e2c0447ad
2018-03-15 07:00:04 +00:00
OpenStack Proposal Bot 6bb5bd7e43 Updated from global requirements
Change-Id: Id95f7b7baa9099653da2c5414661995cc22eb13c
2018-03-13 06:54:40 +00:00
OpenStack Proposal Bot 0ce6bce9e5 Updated from global requirements
Change-Id: I76719f244c1a5cf34afa0f8c967df231fc72792f
2018-03-10 13:15:06 +00:00
OpenStack Proposal Bot c2b6611ddf Updated from global requirements
Change-Id: I9c7368b19c3774746c9562d52876021baac2e880
2018-01-24 00:55:27 +00:00
OpenStack Proposal Bot 0aae151a30 Updated from global requirements
Change-Id: I150316afff013a6c114992daf67cdc612f85251b
2018-01-17 20:35:20 +00:00
OpenStack Proposal Bot 4a6671b8d1 Updated from global requirements
Change-Id: I2f86b636737ffce95f1f2e1e026e8834bd8e42b4
2017-11-16 11:05:33 +00:00
Pavlo Shchelokovskyy 0e4b5b8c05 Cleanup test-requirements
- python-subunit is not used directly anywhere
  and it is dependency of both testrepository and os-testr
  (probably was used by some tox wrapper script before)

- python-ironicclient is not used anywhere
  (probably should've been used by functional tests,
  but we still have none of those).

Change-Id: I42aeb75dab18d90d60792f070599532fd3d9af10
2017-09-25 06:30:33 +00:00
OpenStack Proposal Bot 7f4275959a Updated from global requirements
Change-Id: I36ee4f2127fd7fef0d81e2efa69a717369472968
2017-09-16 23:12:57 +00:00
OpenStack Proposal Bot 80161f1751 Updated from global requirements
Change-Id: I062934f70d84ee50d90a0ec189487a0f2ecb29bc
2017-09-13 23:57:46 +00:00
OpenStack Proposal Bot 8a8fcdc216 Updated from global requirements
Change-Id: Ic85c561d0998cc7c5027119236a2368acf1ed0fb
2017-09-12 04:15:47 +00:00
John L. Villalovos 3700e7c6d5 flake8: Enable some off-by-default checks
Update test-requirements.txt to use latest versions of:
    * flake8-import-order
    * hacking

Enable the following off-by-default checks:
    * [H204] Use assert(Not)Equal to check for equality.
    * [H205] Use assert(Greater|Less)(Equal) for comparison.

Fix code that failed H204 and H205. In this case the fix was to add:
  # noqa

As we want to ensure that these particular tests are calling the
desired comparison operators.

Change-Id: If9cba62c832e301ac81320f9142e91319f0e40a9
2017-09-07 13:21:30 -07:00
OpenStack Proposal Bot b8d4b55942 Updated from global requirements
Change-Id: I1c708b4dfeb1cf62635ea28386866e5e1fea3a42
2017-08-22 11:46:38 +00:00
OpenStack Proposal Bot 9ffc9eb548 Updated from global requirements
Change-Id: I54fdba274c2fa5bfa76d87b4a478e8eb40e9d355
2017-07-29 21:44:33 +00:00
OpenStack Proposal Bot daf01d854c Updated from global requirements
Change-Id: Ie86268aa40e0604c92d6997604ebf9d30e66a68d
2017-07-14 15:40:59 +00:00
Sam Betts 31ac1b72f2 switch from oslosphinx to openstackdocstheme
Change-Id: I2f1f8f76b6ec732a770707a259dc72a2f576e46c
2017-07-04 15:32:27 +01:00
OpenStack Proposal Bot b7d3824f41 Updated from global requirements
Change-Id: I905b2d66634cb0474cd5f56ca427290c423cf8a9
2017-06-27 17:43:38 +00:00
OpenStack Proposal Bot 897e1b6851 Updated from global requirements
Change-Id: I396af4a4620683a07121b908dbe645233cff8432
2017-06-05 21:49:05 +00:00
OpenStack Proposal Bot 4768052c4f Updated from global requirements
Change-Id: Iab43081437b0df77de7c284d3000476d068c0561
2017-05-18 21:31:04 +00:00
OpenStack Proposal Bot 20dba3fb88 Updated from global requirements
Change-Id: I661a08ce6d9cc94b9cd6905777b9dad1d92bd14c
2017-05-16 12:20:42 +00:00
OpenStack Proposal Bot a5fb9ae50a Updated from global requirements
Change-Id: I539741ad2499a62cb2baa00f654ed377bd1fe4e1
2017-04-07 06:05:15 +00:00
OpenStack Proposal Bot b613a3ccce Updated from global requirements
Change-Id: I244a1d6f66d61a8185ff930f0ccf73fdcaaf105a
2017-03-23 22:49:30 +00:00