yaml.load is considered unsafe. yaml.safe_load is the
recommended method to use.
The yaml.load is only being called from scenario tests,
and from a forensic tool that is unused. Therefore this
code change has no runtime impact.
This allow unsuppressing the following pylint error
E1120 no-value-for-parameter
This allow unsuppressing the following bandit error
B506: Test for use of yaml load
Adding a new bandit zuul job, and removing the pinning
of the version of bandit for this repo.
Test Plan:
PASS: tox -e pylint
PASS: tox -e bandit
PASS: build-pkgs -p nfv
Story: 2010531
Task: 47174
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ie60dcf98425c95e103d22e7be4212de1954550bf
tox changes:
- remove python2.7 and python3.6 unit test targets
from tox.ini since only python 3.9 is supported
- remove the (junk) functional target from tox.ini
- fix yamllint target in tox.ini so it will actually
process files. Also added a basic yammlint settings file.
- nova-api-proxy tox jobs are now setup for py39
- Removed the py27 limitations from requirements files.
- Removed the upper limits for pylint and astroid.
- Added additional suppressions for new pylint codes.
Zuul changes:
- remove py27 job from zuul
- remove the unused (never working) devstack job
- set the parent zuul jobs to be the jobs defined under
openstack-zuul-jobs rather than just zuul-jobs
- Specify debian-bullseye (python3.9) as the nodeset.
ubuntu-jammy iss python3.10, ubuntu-focal is python3.8
- override tox constraints file to use the STX constraints
This means starlingx/root needs to be a required project
- Removed the nodeset from the pep8 jobs.
Note: these changes do not affect runtime for NFV.
Test Plan:
Pass tox in nfv directory of (debian) dev env.
Pass tox in nova-api-proxy directory of (debian) dev env.
build-pkgs -p nfv
Story: 2010531
Task: 47146
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I6dad77bec40e9b64a9314b237270af046728efb3
This change will allow this repo to pass zuul now
that this has merged:
https://review.opendev.org/c/zuul/zuul-jobs/+/866943
Tox 4 deprecated whitelist_externals.
Replace whitelist_externals with allowlist_externals
Partial-Bug: #2000399
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I2dc26705317a5e6194318991ffad5c9d14f52922
The upgrade test was written to copy a file required for
the test, but did not handle the file already being processed.
This fix adjusts the setup for the unit test to handle this
and allows the recreate to be removed, thus reducing designer
tox testing time (40 seconds down to 4 when re-running a single test)
This also aligns the version of hacking and pylint as the same as
other starlingx repos. A new pylint was released which was
breaking tox.
The code changes are to fix whitespace (rather than suppressing):
E305 expected 2 blank lines after class or function definition
E117 over-indented
Three new hacking warnings are being suppressed:
W503 line break before binary operator
W504 line break after binary operator
W605 invalid escape sequence
Un-suppress these codes which are not broken in the code:
E123 closing bracket does not match indentation of opening bracket
E501 line too long (tox sets max length instead to a large val)
F823 local variable referenced before assignment
yamllint 1.26.1 does not work with py2 or py3 in our env, so clamp it.
Story: 2008137
Task: 42200
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: Ia623315c5f1a690d20f597242b7722601776f26d
When we execute pep8 locally, we find there is
DEPRECATION WARNING, This warning will be an error
in tox4 and above, this change is to fix this.
Change-Id: Iaebe8ffe3aa1b92956403c679600fad0098d8329
Partial-Bug: #1835386
Signed-off-by: junboli <junbo85.li@gmail.com>
* Add a basic DevStack job to exercise this
* Clean up plugin to match DevStack conventions
Change-Id: I5b079eacebf9ddb433b5e831d557afe6a1be6880
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I8fd0c040a8c827d2f3b6f0ae796b1459713d3bf2
Baseline changes to comply with OpenStack API documentation
from OpenStack Documentation Contributor Guide [0]:
- [1] How to document your OpenStack API service
- Add SPDX-License-Identifier: Apache-2.0
[0] https://docs.openstack.org/doc-contrib-guide
[1] https://docs.openstack.org/doc-contrib-guide/api-guides.html
Story: 2002712
Task: 26671
Change-Id: Ia16194f531328f2e936b296a489b936b384addb5
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
Baseline changes to comply with Release Notes Management
based in Reno [0]:
* Use build-openstack-releasenotes job for release notes
(We can't use the OpenStack releasenotes template as it includes
publish jobs, stx needs its own)
* Add newnote tox environment as convenience for creating new release
notes, re-using the releasenotes venv.
* Change to SPDX-License-Identifier: Apache-2.0
[0] https://docs.openstack.org/reno/latest/
Story: 2003101
Task: 26667
Change-Id: I33b3083a952faf36168faec4255bec0f25edf9ca
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
Added a python3 tool called bugbear as part of flake8
Moved the tox.ini for nfv to a new location.
Removed nfv tox calls from the bottom level tox.ini file
Specified the queens upper-constraint. This is because the
kubernetes client from pike is not what is shipped.
Adds a separate tox.ini for nova-api-proxy.
Fix two of the errors flagged by bugbear:
B006: Do not use mutable data structures for argument defaults.
B306: BaseException.message has been deprecated as of Python 2.6
and is removed in Python 3.
Fix unused imports in Flake8
F401 '<module>' imported but unused
Clean up two pylint errors:
W0102 dangerous-default-value
W0631 undefined-loop-variable
Story: 2003499
Task: 26410
Change-Id: I61deb6a002f963cd58fe019bb54a4c3296809391
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The following flake8 errors are no longer suppressed:
E116 unexpected indentation (comment)
E261 at least two spaces before inline comment
E265 block comment should start with '# '
Story: 2003499
Task: 26408
Change-Id: I17d8bbf9c1511a58a7322606f41bfbb01a841953
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
These errors are no longer suppressed:
E225 missing whitespace around operator
E226 missing whitespace around arithmetic operator
E231 missing whitespace after ','
E241 multiple spaces after ','
Story: 2003499
Task: 26386
Change-Id: Ic97e46b0a3b57456740a2a5935a8a3e6d3b81427
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Turn on zuul voting for py27 in stx-nfv
Modify tox envlist to reflect check jobs
Add pylint to gate jobs
Story: 2003499
Task: 26217
Change-Id: I1c966ac571d88a4487752ae8bbcdc219e4c2b66c
Signed-off-by: Lachlan Plant <lachlan.plant@windriver.com>
Flake8 and Hacking offer stricter style checks than pep8.
This submission fixes these codes:
E305 expected 2 blank lines after class or function definition, found 1
E722 do not use bare except'
F841 local variable 'blah' is assigned to but never used
H101: Use TODO(NAME)
H201: no 'except:' at least use 'except Exception:'
H237: module commands is removed in Python 3
H238: old style class declaration, use new style(inherit from `object`)
This submission enables 2 additional checks that are off by default
H106 vim config in files
H203 Use assertIs(Not)None to check for None
8 hacking codes and 2 flake8 types were added to the ignore list
and will be fixed by later updates.
An optional hacking code H904 will be enabled and the code fixed
by a later commit
Story: 2003499
Task: 26195
Change-Id: I48f99fc0dd41addc574c81cee6662600faeb8e75
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The following pep8/flake8 warnings are no longer
being suppressed:
E101 indentation contains mixed spaces and tabs
E203 whitespace before ':'
E211 whitespace before '('
E228 missing whitespace around modulo operator
E251 unexpected spaces around keyword / parameter equal
E302 expected 2 blank lines, found 1
E303 too many blank lines
Story: 2003499
Task: 26190
Change-Id: I8df57783417e4372a008f876365f9c24d2c0cb4b
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This invokes pylint on all the nfv code.
The pylint.rc file currently suppresses failing lint tests.
In later submissions those suppressed types will be enabled
and their code fixed.
Story: 2003499
TaskId: 24944
Change-Id: I4726927a9e5e76a242dec3f7b25f51b2887e505e
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Adds a py27 unit test target for nfv.
The unit tests for nfv were written using nose.
Change-Id: I001995be5f2af1d45242eb3c0e05e0615352b173
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Also remove bashate from the linters job and the placeholder shell script
as there are normally no shell scripts in this repo.
Change-Id: I41f86245f5809471f894b18a7fa320c938f9e861
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
yamllint warnings are fixed.
bashate failure was due to not finding any shell scripts.
Added a generic shell script under the test folder.
Change-Id: If4b8a416422356be318f875a28ae2b1785ef818b
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The code has over 2000 warnings related to indentation and line length
Suppressing these warnings allow us to fix those warnings in manageable code chunks
In addition to suppressing many of the warnings, this submission fixes
W191 indentation contains tabs
W291 trailing whitespace
W292 no newline at end of file
W293 blank line contains whitespace
W391 blank line at end of file
W503 line break before binary operator
Change-Id: If40f73d7312aec574d8141ea1af2cc6f1b4b8a46