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: I12e1a2a4a22116cabd09a3b808f871d98e4bd1f2
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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: I5486638526b26ce0710c7b1926e408dd70057a66
Bandit 1.6.0 introduces a regression[0] with the -x option,
a fix is expected to be included in 1.6.1 soon.
This commit also aligns Sphinx requirement with the requirements
project [2]. This is required to pass requirements-check.
The lower bound for sphinx was missing and requirements-check
now requires it, so the lower bound sphinx >=1.6.2 was added.
[0] https://github.com/PyCQA/bandit/issues/488
[1] https://github.com/PyCQA/bandit/pull/489
[2] https://review.opendev.org/#/c/657890/
Change-Id: I937cfa722f5234ca4d5506047001d9cb07728cd8
Older hacking depends on pep8, but pep8 module is replaced by
pycodestyle. This can be resolved by updating hackinng version.
This commit also fixes E117 (over-indented) and
W605 (invalid escape sequence) warnings.
pep8 is dropped from lower-constraints.txt as it is no longer used.
Change-Id: I3a8e3b0dedf9422e4db02b525b333d12ce012a95
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: Ib58745d5c0d98fb79eb3cf7278c2cbfb5160efcd
_clean() method is renamed to clean() in osprofiler 2.3.0.
It was suggested in a past neutronclient review.
Closes-Bug: #1783789
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Depends-On: https://review.openstack.org/#/c/592018/
Change-Id: Ic8e03db85dc08cfdcac5507e99ecdf7eac8eb972
Neutron uses bandit to detect security issues. This patch adds bandit
to the pep8 gate to automatically lint for security issues in
python-neutronclient.
Change-Id: Ifd8caf65cc89e7d6d6ebc8f58539741cfbab839b
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.
Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.
Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file
exists and causes hacking rule unit tests.
Change-Id: I61e683ab0119e4ae90b7107f0690528d789e3875
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848
Change-Id: Ifc984fa1c425999fabc3a62b6f6f3f29fa1100af
To be able to create profiling traces for Neutron, client should be
able to send special HTTP header that contains trace info.
This patch is also important to be able to make cross project
traces. (Typical case nova calls neutron via python client, if
profiler is initialized in nova, neutron client will add extra
header, that will be parsed by special osprofiler middleware in neutron
api.)
Closes-Bug: #1335640
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Change-Id: Ic11796889075b2a0e589b70398fc4d4ed6f3ef7c
Enable neutronclient OSC plugin support.
This patch set does the following:
- Establishes OSC plugin structure for commands and unit tests
- Creates the OSC plugin
- Adds OSC to test-requirements.txt
Co-Authored-By: Akihiro Motoki <motoki@da.jp.nec.com>
Change-Id: I9a20bc7a3d8aa7b631fb0fd534fc5705c23326ce
Related-Bug: #1521291