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>
We've added a new distributed-cloud process, so update the sample script.
Story: 2007267
Task: 42000
Signed-off-by: Chris Friesen <chris.friesen@windriver.com>
Change-Id: I16522744c9526e134577bda80cf91a8308eee889
Cap bandit to v1.6.2 so we do not pull in a python3 only version.
Without this fix the unit tests will fail to setup and run properly.
Closes-Bug: 1916494
Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I7afbc8d224f28146af42f43593586cd680a52aaf
The EXCLUDE_LIST_FROM_TAR list in cgcs-patch build_srpm.data includes
entries to exclude .tox and other dirs when building the package, but
the path included an extra directory level. This update corrects the
paths.
Change-Id: I8b3641e4e86f52ef7b9fb56f9eb3df289935e188
Closes-Bug: 1908940
Signed-off-by: Don Penney <don.penney@windriver.com>
Update remaining StarlingX packages with hardcoded TIS_PATCH_VER to
use PKG_GITREVCOUNT where possible, with offsets as needed to ensure
the version is incremented above the hardcoded version.
Change-Id: I877a6c0802a707863a3b6c7d430146431e10a3ad
Story: 2008455
Task: 41459
Signed-off-by: Don Penney <don.penney@windriver.com>
If a cold reboot occurs in the middle of patch installation, the
system can be left in a state where the patch-agent is unable to
perform its operations properly. The RPM database can be left with
duplicate RPMs due to the incomplete transaction, which can in turn
lead to DNF update installation issues.
This update adds detection of duplicate RPMs to the patch-agent to
avoid attempting installation until the system is recovered.
Additionally, protection is added to the sw-patch init to treat
multiple reboot patch installations as an error, to avoid boot loops.
Closes-Bug: 1904928
Change-Id: Ia06a6f669c45398d7956f2ac2caa76c447bc1b16
Signed-off-by: Don Penney <don.penney@windriver.com>
pylint-2.6.0 introduced a new W0707 warning related to a new
capability in python3. Given cgcs-patch is still running py2, this new
warning is being ignored. When we move to python3, we will review the
pylint warnings at that time.
Change-Id: If59dcc62ce68d7bb7b119018502ba6d318e7746a
Closes-Bug: 1902916
Signed-off-by: Don Penney <don.penney@windriver.com>
This is the type of script that can be invoked when
applying designer patches to test distributed cloud changes.
Change-Id: I3c743bf550e28f54f5dd4b1100ef561573e88e1a
Story: 2008137
Task: 41178
Signed-off-by: albailey <Al.Bailey@windriver.com>
The error handling for the patch release check in the setup_patch_repo
utility has an invalid format string. Rather than providing a helpful
error message, an exception occurs due to the format string.
Change-Id: I1a5445f190353e4f37d2a8d0844327942b93cdf3
Closes-Bug: 1900634
Signed-off-by: Don Penney <don.penney@windriver.com>
Update the kubernetes patch script to include
apply-active-release-only metadata. This will ensure the patches
that contain the kubernetes RPMs cannot be applied to an imported
platform load, which could upversion kubernetes (during an
upgrade) to a version that is not supported by the running load.
Change-Id: I2987f743f7708abc26ab2f67173a7e1cb9b20a4f
Story: 2008055
Task: 40735
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
The parsing of the UNREMOVABLE tag in the patch XML is setting the
wrong metadata flag. It's setting "removable" instead of
"unremovable", meaning the UNREMOVABLE tag has no effect.
Change-Id: I6f497a8a76e1c46b33edf896e71ed1266004d964
Closes-Bug: 1891729
Signed-off-by: Don Penney <don.penney@windriver.com>
This reverts commit 4146e2a859.
Removed the calls to tox from within tox, and setup the
top level tox.ini for bandit and flake8 for the sub folders.
Change-Id: I682869c8e839f4f59cdce48cd0b97b4a4324f4a7
Story: 2004515
Task: 40232
Signed-off-by: albailey <Al.Bailey@windriver.com>
The py3-bandit and py3-flake8 zuul jobs are failing due to a tox
environmental issue that will need to be resolved. This update
disables those jobs until the issue can be fixed.
Change-Id: I02bfacf5ca4def1d0f9997b317bbbe053cbb82f9
Signed-off-by: Don Penney <don.penney@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>
When the patch-agent is notified by the patch-controller of a new
patching operation (patch_op_counter in HELLO is incremented), it will
run a new software query consisting first of running "dnf makecache",
then checking the software repositories for changes. In rare cases,
the metadata returned to dnf when it makes the query could be stale,
resulting in the patch-agent believing the current software is
up-to-date.
In order to protect against this, the patch-agent will now verify the
repository revision id for the updates repo. If the revision id has
not changed when it is reasonable to expect it could have (ie. the
patch_op_counter has increased, indicating the repository may have
been updated), the patch-agent will retry once to allow for any
potential caching to have cleared.
Change-Id: I3a44ed86e16cd9fe67f0b0e763c95a5a7e126cf8
Closes-Bug: 1884094
Signed-off-by: Don Penney <don.penney@windriver.com>
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
Disable openstackdocs_auto_name to use 'project' variable as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: Idcf44f0980a298bd4d63e10c178b72372a449839
1. Rename TIS to StarlingX for .service file
Test:
After the de-brand change, bootimage.iso has been built in the flock
Layer and installed on the dev machine to validate the changes.
Please note, doing de-brand changes in batches, this is batch12 changes.
Story: 2006387
Task: 39650
Change-Id: I3a4836563836246f90e195bd3f5212af73420fbe
Signed-off-by: Sharath Kumar K <sharath.kumar@intel.com>
Updating scripts used to build k8s upgrade patches to handle
current kubernetes version (1.18.1). My previous commit
missed changes to the preapply/preremove scripts.
Change-Id: I70b2796f625ac79df1de08e4e802d70e3e33d36a
Story: 2006781
Task: 38479
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
Updating scripts used to build k8s upgrade patches to include
additional required package (playbookconfig) and to handle
current kubernetes version (1.18.1).
Change-Id: I768466098842fa8d489bf91318ef2c29963ef446
Story: 2006781
Task: 38479
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
1. Rename Titanium Cloud to StarlingX for .spec files
Test:
After the de-brand change, bootimage.iso has built in the flock layer
and installed on the dev machine to validate the changes.
Please note, doing de-brand changes in batches, this is batch8 changes.
Story: 2006387
Task: 39273
Change-Id: I214acdb6e4b99c484c07dcca24b4c9861624be7f
Signed-off-by: Sharath Kumar K <sharath.kumar@intel.com>
This commit replaces the use of "repoquery" in the
upgrade-start-pkg-extract utility with "dnf repoquery".
Story: 2007403
Task: 39059
Change-Id: I8bc86af11cc7adc85b6d5d30f3a7368581c7988c
Signed-off-by: Carmen Rata <carmen.rata@windriver.com>
This update adds the setup_patch_repo.sh script to starlingx/update
for use by the patch-iso utility. This file was missed from initial
seeding of StarlingX.
Change-Id: I48b7caa2a41347ada6185e8d262d3b3d330dd37e
Partial-Bug: 1863011
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>
Provide a make_kube_patch.sh script that will build patches
that can be used to upgrade kubernetes. Also includes sample
preapply/preremove scripts that will be included in the
patches.
Change-Id: Ifab05e9d407d9a7c3d8c519c90add1b3857ecdf2
Story: 2006781
Task: 38479
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
- Use updated project name in titles/text
- Correct text for link to Storyboard (docs)
- Correct capitalization in section headings
- Correct formatting for section headings
- Update project name in link to release notes, api-ref
- Update project name in config for docs/releasenotes/api-ref
Story:2007193
Task:38341
Change-Id: I4369fef2a401810ff9cc9a443a3f0572fc327174
Signed-off-by: Kristal Dale <kristal.dale@intel.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>
As smartpm is no longer used, this commit removes the remaining
comment reference from the patching code, and deletes the unused
smart-helper files.
Change-Id: Iac557403e43c1e732eb38393bb2cfeb6fc6c3573
Story: 2006227
Task: 38136
Signed-off-by: Don Penney <don.penney@windriver.com>
As the smart package manager is not supported under python3, we're
migrating the patch-agent to use the python2 DNF libraries in
preparation for CentOS 8. This impacts how the patch-agent queries the
repos and manages installed software, but is done without changing how
the patch-agent and patch-controller exchange information, to ensure
we don't impact cross-version communication in an upgrade scenario.
Depends-On: https://review.opendev.org/700960
Change-Id: I00729a487c24ba5c182a9a2a48e2024be9260978
Story: 2006227
Task: 37932
Signed-off-by: Don Penney <don.penney@windriver.com>
The rpmUtils.miscutils.stringToVersion function will not be available
in CentOS8, as it is not currently provided for python3. A similar
function exists in cgcs_patch.patch_functions, using regex to parse
the version from an RPM filename. This update adds a new function,
expand_pkgver, implemented in a similar fashion using regex, providing
the same capability as rpmUtils.miscutils.stringToVersion.
Change-Id: I2a04f3dbf85d62c87ca1afcf988b672aafceb642
Story: 2006228
Task: 37871
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>
This commit addresses issues detected by the updated python3 pylint:
- Added a return code to the report_app_dependencies function to
satisfy the E1111 error reported.
- Added line-specific pylint disable for unused-argument for cases
where the inclusion of such arguments in the function signature was
intentional.
- Added line-specific pylint disable for the duplicate-except case
found, as python3 has merged IOError into OSError, while these are
separate exceptions in python2. Once we're running solely on python3,
this duplicate exception handling can be dropped.
Change-Id: I96a521288e71948f06ad0c88a12c8f475ed8bc99
Closes-Bug: 1855180
Signed-off-by: Don Penney <don.penney@windriver.com>
This also adds cgcs_make_patch folder for pylint
pylint is invoked with two different pylint.rc files
so that different codes can be suppressed for the
two different code structures.
Change-Id: I0d7a87ed435ed716a3c1ea98f5d7badfd2adac7d
Story: 2004515
Task: 37701
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>
This update includes the following:
- Ensure the sw-patch init script does nothing on AIO-SX before
initial configuration is complete. This protects against misleading
alarms indicating patch installation failure, stemming from
pre-configuration networking issues.
- Enhance install-local support to allow for patch installation after
ansible bootstrap playbook is applied, but before system configuration
has been completed.
Change-Id: Id7a5b4f120449fd3f6e71c83167586dc66e8a91e
Closes-Bug: 1847872
Depends-On: https://review.opendev.org/696410
Signed-off-by: Don Penney <don.penney@windriver.com>
Adding a new patch API to determine if a patch (or list of patches)
is in the available state. This is necessary to support
kubernetes upgrades, which will require certain patches to be
available before a kubernetes upgrade is started.
Change-Id: I13de8385c59dd15550cee646b3ed9b90d2a7e379
Story: 2006590
Task: 37370
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
devstack is failing, most likely because StarlingX
uses postgres, and postgres was dropped in devstack by:
cf1c847191
I am not removing the devstack job declaration, or the devstack files
because in the future StarlingX could convert from postgres to
another DB backend, at which point we might want to revisit
using devstack.
Change-Id: Iaac99f28b24609764e7c0cf4750122d765b13420
Partial-Bug: 1848557
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
This commit introduces a new patch metadata tag to indicate that the
patch cannot be applied in an upgrade, that it can only be applied
when the running release matches the patch.
Story: 2006590
Task: 36890
Change-Id: I1b64e254e12c54695ca3691cfb7e446866089707
Signed-off-by: Don Penney <don.penney@windriver.com>
This update introduces support for pre-apply and pre-remove semantic
checks. These allow for the inclusion of tests prior to applying or
removing specific patches. These tests must not make any system
changes. They can only perform queries, and only run on the controller
handling the apply/remove (which could be either controller).
Included in this update:
- Skip the semantic check if initial configuration has not yet been
applied on the controller.
- Pass a list of patches and their states to the semantic check as
arguments, allowing the semantic check to look for states of specific
patches if need be. The semantic check must not run any patch queries,
as the query would not be handled until the apply/remove operation
completes.
Story: 2006590
Task: 36889
Change-Id: Ia670e16768dc757bd3f70774348770af6e492ebe
Signed-off-by: Don Penney <don.penney@windriver.com>
A recent update to sysinv added a new import:
https://review.opendev.org/#/c/679457/7/sysinv/sysinv/sysinv/sysinv/common/utils.py
This file is imported in cgcs-patch and caused a tox failure
because it could not be found. This commit updates the tox.ini and
.zuul.yaml files to allow for installation of fm-api.
Change-Id: I12d605d2782f7f32add4428507645cc31caadea2
Closes-Bug: 1846244
Signed-off-by: Don Penney <don.penney@windriver.com>