- Removed the old python2 entries
- Replaced mock with unittest.mock
- Unsuppressed most flake8 and pylint checks
- Added the startup script to flake8 checking and fixed
a python3 syntax issue in the error handling.
- Regenerated an updated / modern pylint.rc
- Updated the upper-constraints to be Debian and python3
Test Plan:
Pass: Build / Install / Unlock
Pass: trigger a patch alarm
Story: 2010642
Task: 47815
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Id8c612a677253dfc53931719af7823572d1536ef
The Debian packaging has been changed to reflect all the
git commits under the directory, and not just the commits
to the metadata folder.
This ensures that any new code submissions under those
directories will increment the versions.
Test Plan:
PASS: build-pkgs -p enable-dev-patch
PASS: build-pkgs -p python3-patch-alarm
PASS: build-pkgs -p cgcs-patch
Story: 201055
Task: 47225
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ieb02cbdd8234338bb8712096b7cccd2027582983
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
Remove the deprecated cgcs-patch(CentOS) jobs from zuul
sw-patch directory contains the Debian support.
Move from xenial to bionic for patch-alarm zuul job.
Partial-Bug: #2000399
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ia0dcf61fc4a2c7911434158dd2e8bca7a787249a
The original cgcs-patch is rpm based which requires a
complete re-write to work on ostree/dpkg systems like Debian.
The code has been forked, since the older Centos env and
python2.7 are end-of-life.
Forking the code allows all new development to not
require re-testing on Centos.
The debian folder under cgcs-patch has been moved
under sw-patch
Renaming and refactoring will be done in later commits.
pylint is un-clamped in order to work on python3.9
Some minor pylint suppressions have been added.
Test Plan:
Verify that this builds on Debian
Verify that the ISO installs the new content on Debian without
breaking packages that import cgcs_patch.
Verify patching service runs on Debian
Co-Authored-By: Jessica Castelino <jessica.castelino@windriver.com>
Story: 2009101
Task: 43076
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I3f1bca749404053bae63d4bcc9fb2477cf909fcd
Replace dl_hook with "src_path" and "src_files"
Test Plan:
Pass: successfully build patch-alarm
Pass: No difference comparing with the result of dl_hook
Story: 2009101
Task: 43897
Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Change-Id: I7f7a59271d5f290b6f6a8778984bc5d3176536cd
Due to a recent change in fm-api's directory structure, unit tests would
fail since the virtualenv would not be able to find fm-api/setup.py.
Adjust the tox.ini to point to the correct directory. Tested locally
by running tox.ini.
Depends-On: https://review.opendev.org/c/starlingx/fault/+/806046
Story: 2009101
Task: 43091
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: If55a6d92dc861b23516637fcb90c52852c3fd92a
A lot of work has gone into making sure that StarlingX is python3
compatible. To ensure future compatibility, enable the python3
portability checks. Disable the checks that are raising errors.
Another set of commits will address the offending code.
Add following suppress warnings in cgcs-patch/pylint.rc:
- W1618: no-absolute-import
- W1619: old-division
- W1630: cmp-method
Add following suppress warnings in patch-alarm/pylint.rc:
- W1618: no-absolute-import
Story: 2006796
Task: 43198
Signed-off-by: Ricardo Alvim <Ricardo.AlvimNetto@windriver.com>
Change-Id: I0cbe384a72792cf123976f0de2020ae6f3fcd208
Enable python3.9 in tox.ini and zuul gate. Tested locally
by running tox and running in the zuul gate.
Story: 2009101
Task: 43105
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I44eaeb134d6b7b54788469fa469b04674aeb90c0
Wrap DaemonRunner class from 3rd party python-daemon library which
is not compatible with python3.
The solution was lifted from:
https://review.opendev.org/c/starlingx/utilities/+/786837
as it was the acceptable way to work around python-daemon limitations.
Patching python-daemon was not accepted as per:
https://review.opendev.org/c/starlingx/integ/+/785523
Story: 2008454
Task: 42789
Depends-On: I3c68322603eaaf9a78d101b5b1198e9582497105
Signed-off-by: Andrei Grosu <andrei.grosu@windriver.com>
Change-Id: I66b2ac6825b78228a40869a3721e6853f2bbe83f
(cherry picked from commit fd1717baee)
cgts-patch was updated to use pycryptodomex.
patch-alarm has a dependency on cgts-patch.
Need to pull pycryptodomex into the test env.
Story: 2008454
Task: 42789
Signed-off-by: Andrei Grosu <andrei.grosu@windriver.com>
Change-Id: I15728ec80221bf8d473ba91a894d2c272771cc34
(cherry picked from commit 3b62a6e7cb)
The py2.7 jobs need to specify xenial
The py3.6 jobs need to specify bionic
The focal zuul nodes only have python 3.8 installed in them
Zuul targets that invoke a generic python3 interpreter such
as pep8 is not specified.
Also ignore H216 since we still use py2.7.
The copyright date was updated in order to trigger
the zuul jobs, as a no-delta type of change.
Partial-Bug: 1928978
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I81fd790dfc8a665a4e4e0ff59a013af7921b6e06
Signed-off-by: Charles Short <charles.short@windriver.com>
This update revises the cgcs-patch and patch-alarm package builds to
drop the old and unneeded custom build_srpm script, in order to use
the PKG_GITREVCOUNT feature for package versions.
Change-Id: If541f55340565cf73213aeac511e69487e53fa11
Story: 2006166
Task: 40137
Signed-off-by: Don Penney <don.penney@windriver.com>
To prevent the warning about a newer version of pip
available, the following env setting was added
PIP_DISABLE_PIP_VERSION_CHECK=1
To prevent sub-calls to tox from using the default pip
cache location, rather than whatever a user may override
using xdg env variables, the following has been added:
passenv =
XDG_CACHE_HOME
The python patch scripts are now validated by flake8.
All flake8 tox targets are triggered from a single zuul job.
Story: 2004515
Task: 38581
Change-Id: I105512edbd3da15480355e30c0dd14933584a47b
Signed-off-by: albailey <Al.Bailey@windriver.com>
This commit adds flake8-bugbear to the patching tox test in order to
identify potential py3 issues and address them now.
Change-Id: I2219e61eff16cc69afa50d554e9f1dd0bb2f1517
Story: 2007050
Task: 38146
Signed-off-by: Don Penney <don.penney@windriver.com>
A newer version of hacking was released which enables additional
checks and is breaking flake8 and zuul.
Hacking has now been clamped at 2.0.0 in test-requirements.txt
Added the same for patch-alarm, although it was not failing.
The new checks that are fixed are:
H106: Don't put vim configuration in source files
W605 invalid escape sequence
F632 use ==/!= to compare str, bytes, and int literals
F841 local variable is assigned to but never used
The following flake8 extension check has been removed:
H904 Delay string interpolations at logging calls
Closes-Bug: 1856585
Change-Id: I8bdc94539f4a6ce243c4e30efc07eed3bad1ce62
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Bandit gate jobs are used by openstack for security checks.
Adding a zuul job so that any new bandit failures
will be caught.
patch-alarm runs cleanly and does not currently suppress any
bandit checks.
cgcs-patch suppresses several bandit checks which may be
updated and enabled by future commits.
Change-Id: I01414c48266cfb3cb6df9ef400a350a570938189
Story: 2004515
Task: 37697
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Story: 2006166
Task: 35687
Depends-On: I6c62895f8dda5b8dc4ff56680c73c49f3f3d7935
Depends-On: I665dc7fabbfffc798ad57843eb74dca16e7647a3
Change-Id: I70b6d52a13836e16139a0ca3f42b9e91e06e43b6
Signed-off-by: Scott Little <scott.little@windriver.com>
Depends-On: I5618547e7e74b76d174f10897b1c747931738cd6
Signed-off-by: Scott Little <scott.little@windriver.com>
This update sets up the initial testing framework for
the patch-alarm module, with a basic test case.
Additionally, this restructures the tox.ini files. Now
that each python module has its own tox.ini and tests,
the top-level tox.ini can recursively use those. As well,
the Zuul setup can now split the jobs for each module.
Change-Id: I79eed868c5b42e2545ccf0c11dbbbea4336b9b19
Story: 2005939
Task: 34783
Signed-off-by: Don Penney <don.penney@windriver.com>
the #!/usr/bin/env is not recommended for ensuring we get the
correct auto-dependency generation.
Change-Id: I87fdf44d38496ba2ff23e2f2f5836943e790f0c2
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Flake8 currently ignores the following errors:
H237: module is removed in python3
H238: old style class declaration
Enable them for python2/3 compatibility
Change-Id: I4dd66c8ab388119b4abab83fda48a89e108f7821
Story: 2004515
Task: 29303
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
The start function of the patch-alarm-manager init script
checks for a valid pidfile to see if the process is
already running. Unfortunately, the code has a couple
of typos that cause the check to fail if the "start"
is called when the process is already running.
This commit fixes the typos.
Change-Id: If46f03a5d042f949db9359d6ddd7f69790ccaf4f
Closes-Bug: 1827326
Signed-off-by: Don Penney <don.penney@windriver.com>
This update adds hooks to the spec files for the following packages
to generate wheels for the python modules:
- cgcs-patch
- patch-alarm
- requests-toolbelt
- tsconfig
Change-Id: Ibdae0a338a1af493ac522757b61bbd6df1da941e
Story: 2003907
Task: 27529
Signed-off-by: Don Penney <don.penney@windriver.com>
Fix below errors
E128 continuation line under-indented for visual indent
E305 expected 2 blank lines after class or function definition, found 1
E502 the backslash is redundant between brackets
E722 do not use bare except'
E741 ambiguous variable name 'xxxxx'
E999 SyntaxError: invalid token
Change-Id: Ic826a70aed2cda984cbafedae154c4812bfa37b5
Story: 2003429
Task: 24624
Signed-off-by: Sun Austin <austin.sun@intel.com>
This update adds pylint to tox and zuul for stx-updates and resolves
most warnings and errors, with some disabled for future resolution.
Change-Id: Ic853202e4793bf89d687b50cbd740d364db85189
Story: 2003371
Task: 24832
Signed-off-by: Don Penney <don.penney@windriver.com>
This update addresses existing bashate and pep8 warnings in
cgcs-patch, patch-alarm, and tsconfig. The bulk of these updates
are style and spacing changes, such as whitespace style conventions.
Story: 2003371
Task: 24433
Change-Id: I44b26d24788907bac0730a952d70ed4bafb87d90
Signed-off-by: Don Penney <don.penney@windriver.com>