Commit Graph

132 Commits (0805514d603668f20766e534dd5f08c0cb753b9c)

Author SHA1 Message Date
Eric Barrett 0805514d60 Enable Unused Variable
Flake8 currently ignores:
F841: local variable is assigned to but never used

Pylint currently ignores:
W0612: Unused variable warning

Enable them for more thorough testing of code

Change-Id: I4c55186f939675cc2c3dc871ad03699d95c6091b
Story: 2004515
Task: 29303
Signed-off-by: Eric Barrett <>
2019-07-19 10:28:00 -04:00
Don Penney c001620050 Restrict permissions on patching logfiles
This update sets restricted permissions on patching logfiles.

Change-Id: I922c6d278dc747c186288a15d12369bbddb40bea
Partial-Bug: 1836632
Signed-off-by: Don Penney <>
2019-07-15 15:01:18 -04:00
Don Penney 6ff6ee1a4d Add missing dependency in cgcs-patch for python-smartpm
The Smart Package Manager (python-smartpm) is used by cgcs-patch
at runtime, but is not included in the package dependencies.
This update adds it to the spec as a Requires.

Change-Id: I3e9569e5845b3f5c6259887d423b2b9ec912e15e
Closes-Bug: 1836214
Signed-off-by: Don Penney <>
2019-07-11 12:08:33 -04:00
junboli 7ff00cc5ef Add 'find' in whitelist_externals in tox.ini
Running tox is giving a warning because the tox.ini is
using "find", but the find command is not whitelisted.

Change-Id: I38ece01f6135ebb38a94b9d835e2708a02b35805
Closes-bug: #1835386
Signed-off-by: junboli <>
2019-07-09 02:13:08 -04:00
junboli 1a2147dcdd Fix the error links for starlingx update docs
The storyboard and gerrit doc link are error, and git library
redirect to the correct one, this change is to correct all them.

Change-Id: I282ff4b8a3649490a22db5eca972d40e2cc29452
Partial-Bug: #1835207
Signed-off-by: junboli <>
2019-07-03 09:35:32 -04:00
Zuul b6508eb412 Merge "Add test framework for patch alarm manager" 2019-07-02 13:10:22 +00:00
Don Penney a5e51f98c8 Add test framework for patch alarm manager
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 <>
2019-06-28 17:03:00 -04:00
Don Penney d9c2230050 Add test coverage for cgcs-patch/
This update adds cgcs-patch test cases to cover all utility
functions in

Adding the test cases showed a python3 issue with the if_nametoindex
utility function. In python3, this functionality is provided by the
socket module. In python2, however, the function must be loaded through
the libc library. In order to support the python3 test case execution,
and prepare for moving to python3, the wrapper wrapper function will
use the socket module function for python3 and the libc function

Change-Id: I42d4966154bf22607246060acf31c4792b0e2bbe
Story: 2005939
Task: 34776
Signed-off-by: Don Penney <>
2019-06-28 00:46:14 -04:00
Don Penney f27f1c1539 Add initial unit testing to cgcs-patch
This update sets up the framework for unit testing in
the cgcs-patch module, with some basic test cases.

Change-Id: I209076449353a23bb57e0eee397e614b7e89ad88
Story: 2005939
Task: 34756
Signed-off-by: Don Penney <>
2019-06-27 15:46:43 -04:00
Don Penney cd6927163f Update tox.ini files to use stein constraints
This updates the upper-constraints.txt used by tox for
installing python modules to reference the stable/stein

Change-Id: I2c59e5caefd68638c9e6063bf08d30577eb75e9a
Partial-Bug: 1834216
Signed-off-by: Don Penney <>
2019-06-25 13:52:55 -04:00
Zuul b655dcc9c9 Merge "cgcs-patch: Add LSB headers to initscripts" 2019-06-20 15:26:01 +00:00
Saul Wold 6dc7129a11 cgcs-patch: Add LSB headers to initscripts
These LSB headers are non-functional but still required by OBS
and rpmlint. These sysvinit scripts are actually executed and
controled via the systemd unit files.

Change-Id: I0a6303cdf46120cbdeee65e2c3e556cd458146e0
Signed-off-by: Saul Wold <>
2019-06-20 07:40:46 -07:00
Zuul 53ccf6b09e Merge "cgcs-patch: fix permissions" 2019-06-20 13:04:01 +00:00
Saul Wold 3446103e24 cgcs-patch: Fix shebang header to /usr/bin/python
the #!/usr/bin/env is not recommended for ensuring we get the
correct auto-dependency generation.

Change-Id: I87fdf44d38496ba2ff23e2f2f5836943e790f0c2
Signed-off-by: Saul Wold <>
2019-06-19 12:29:22 -07:00
Saul Wold 7e4a503092 cgcs-patch: fix permissions
These xml files should not have execute bit

Change-Id: I0a74ebd30004dd5fe9c6a104b2359457d7489e12
Signed-off-by: Saul Wold <>
2019-06-19 12:26:16 -07:00
Saul Wold a7103af234 update: Convert wrsroot -> sysadmin
Debrands the user name.

Depends-On: I887464a20fc17d66529caea03be2b445156f9426
Change-Id: I04923b35b687901499ba0b05f30ae0f1c292d07a
Story: 2004716
Task: 28750
Signed-off-by: Saul Wold <>
2019-06-14 15:12:16 -07:00
Mario Alfredo Carrillo Arevalo 4d41130fe2 Add files for tsconfig deb packaging
Add control and rules files to generate tsconfig deb following
StarlingX/MultiOS/Debian Wiki.

Story: 2004792
Task: 30177

Change-Id: I39336822c32463855e58ed1ef4b7214494a3eaa9
Signed-off-by: Mario Alfredo Carrillo Arevalo <>
2019-06-11 15:24:03 +00:00
Don Penney 3701618c02 Add missing python-crypto dependency to cgcs-patch
The cgcs-patch module uses the python-crypto module for
patch signing support, but is missing an explicit dependency
against the module in the package.

Change-Id: Ic37d4bcd8d4988510a457ceb50956e0e0fa68351
Story: 2004764
Task: 33629
Signed-off-by: Don Penney <>
2019-06-07 15:24:51 -04:00
Eric Barrett 25dee38f0b Enable Python3 Compatibility
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 <>
2019-06-06 10:17:52 -04:00
Saul Wold 9ab5317dca tsconfig: Move scripts into tsconfig
Currently the build system automagically copies the scripts directory
into tsconfig as part of constructing the source rpm. In order to
build with OBS (for multi-os), all the files need to be in the correct
directory level, in this case update/tsconfig/tsconfig.

Correct where devstack finds the tsconfig script

Tested with current build-pkgs from clean and verified contents of
both tsconfig RPM and SRPM where correct.

Change-Id: Ib6fdf7aaad5ed91be091b7f1f63365895a8aea7d
Signed-off-by: Saul Wold <>
2019-06-04 10:15:06 -07:00
Matt Peters 319252db74 patching service unicast messaging for loopback interface
IPv6 does not support multicast messaging on the loopback interface.
Therefore to support patch agent to controller messaging when the
management network is associated with the loopback interface it
must operate using unicast messaging.  This is sufficient since it
does not need to communicate with multiple process instances when
operating in this local mode.

Change-Id: I95efd06be9717a76ccbd543c1fd16408fd89dbeb
Closes-Bug: #1830779
Signed-off-by: Matt Peters <>
2019-05-30 22:51:17 -04:00
Zuul 4b1e9e453f Merge "Switch python installation to use DevStack's setup_dev_lib()" 2019-05-06 20:34:31 +00:00
Dean Troyer e3d3b200e6 Switch python installation to use DevStack's setup_dev_lib()
This function does a number of things, specifically it handles the
DevStack USE_PYTHON3 switch transparently so we can run both major
Python versions.

The setup.cfg file in both cgcs_patch and tsconfig are really only
used by setup_dev_lib() right now, making the switch to use pbr
is beyond what I want to do here.

Change-Id: If91248303cba9e6056ac2bc4b7e8771cf193de01
Signed-off-by: Dean Troyer <>
2019-05-06 13:09:30 -05:00
Don Penney 69c9cb0568 Fix bug in patch-alarm-manager start check
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 <>
2019-05-03 14:48:20 -04:00
Zuul 149a688a8a Merge "Backup and Restore Support for containerized StarlingX" 2019-04-24 15:04:59 +00:00
Zuul 0d4c98bd89 Merge "Update tsconfig for cluster-host interface" 2019-04-24 14:22:56 +00:00
Wei Zhou a0791d16ef Backup and Restore Support for containerized StarlingX
Define a constant for /opt/platform/helm/<version>

Story: 2004761
Task: 30522

Change-Id: I58dc94eaac98a87509f57fdd2126188a6917569c
signed-off-by: Wei Zhou <>
2019-04-23 11:35:25 +00:00
Dean Troyer 0a0475b815 Followup opendev cleanup and test jobs
Change-Id: If679cd0742cdf53b27db5f9c94b4c705c46b07ef
Signed-off-by: Dean Troyer <>
2019-04-20 09:24:53 -05:00
OpenDev Sysadmins 227e1c5754 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at with any
questions you may have.
2019-04-19 19:52:36 +00:00
Zuul daccb82329 Merge "Backup and Restore Support for containerized StarlingX" 2019-04-17 16:45:11 +00:00
Wei Zhou 536147855a Backup and Restore Support for containerized StarlingX
Define a constant for /opt/platform/armada/<version>

Story: 2004761
Task: 30522

Change-Id: Ie9958b654abbe0477ab7835633e8884de0e91c57
Signed-off-by: Wei Zhou <>
2019-04-16 09:49:38 -04:00
Teresa Ho 445686f1cf Update tsconfig for cluster-host interface
Updated tsconfig to read the cluster_host_interface instead of
infrastructure_interface parameter in /etc/platform/platform.conf.

Story: 2004273
Task: 30517

Change-Id: I2641c0961f5dff114cb612695b76ac72a80c7554
Signed-off-by: Teresa Ho <>
2019-04-15 21:28:41 +00:00
Tao Liu 181b1e46d0 Add in stx-update
Story: 2004766
Task: 30448

Change-Id: I02c3b7b855198f96a095b733de03b5a2e179b8b2
Signed-off-by: Tao Liu <>
2019-04-10 11:07:06 -04:00
Don Penney 1c110a5405 Remove unneeded wheels from stable tarball
Update the to remove the patch-alarm
and requests-toolbar wheels, as they are not required for the
image build.

Depends-On: I6852620b05f58509c93877d9d8c5754e9aa64c0e
Change-Id: I7f5c84aea7b32cb4fcebfa60297e48a18b8f87ef
Story: 2005248
Task: 30372
Signed-off-by: Don Penney <>
2019-04-05 20:06:05 -04:00
Zuul 5edab5cf8b Merge "Add support for application patch dependencies" 2019-04-05 17:08:53 +00:00
Don Penney 5642a575c5 Add support for application patch dependencies
This update introduces support for application dependencies on
specified software patches. This allows sysinv to query patch states
and to report application dependencies, to block removal of required

APIs introduced:
is_applied: Provide a list of patch IDs. Returns True if ALL patches
  are in Applied (fully applied/installed) state, False if any are
report_app_dependencies: Provide an app name-version string and list
  of patches.
  * Apps are dropped by reporting app name with no patch list / empty
  * Triggers sync with patch-controller neighbour (ie. standby
query_app_dependencies: Query for dict of app => patch list, for all
  reported apps.

On patch removal, the patch-controller checks to see if the patch
being removed is required by any applications. Reject the removal,
if so.
  * Provide backdoor --skipappcheck option to skip this dependency

Change-Id: I6b0dcf3c88312677a95c7eb860cb3b30779554d0
Story: 2005248
Task: 30318
Signed-off-by: Don Penney <>
2019-04-05 12:23:06 -04:00
Zuul ba4bd9391c Merge "Cleanup openstack components from patch scripts and tests" 2019-04-04 19:42:48 +00:00
Al Bailey 16b393f3ab Cleanup openstack components from patch scripts and tests
There were several example patch templates that demonstrated
how to patch some of the openstack processes.
Most of those openstack processes have been removed from bare
metal, so these scripts have been updated or removed.

Story: 2004764
Task: 30343
Change-Id: Ie6339d9f2dbf12e7d1a2b689676cca866b844a83
Signed-off-by: Al Bailey <>
2019-04-04 09:39:18 -05:00
Don Penney bce56d3d81 Remove pike/master files
This update removes pike and master wheel and/or image files,
as these have been replaced with stable/dev.

Change-Id: I3423e2f6a1d247fb1ebe3226c11ac6c0ed1a066f
Story: 2005248
Task: 30327
Signed-off-by: Don Penney <>
2019-04-03 16:36:41 -04:00
Don Penney a4bf173714 Create the stable wheel file
This update supports the migration to stable/dev build streams by
setting up the stable file.

Depends-On: Ib5dc9a7c1d8c37368d073e28d83eeb883766ee3f
Change-Id: I76f107bd58a6eee716aca69a1c03716b4f491df5
Story: 2005248
Task: 30150
Signed-off-by: Don Penney <>
2019-03-24 21:03:21 -04:00
Dean Troyer 968ba6b6c6 Switch to new DevStack base job
Rename stx-devstack-update to flock-devstack-update
and inherit from flock-devstack-base-min

Story: 2005285
Change-Id: I2c4bd243636dd3a469de3bbda7cd42aff333798a
Signed-off-by: Dean Troyer <>
2019-03-22 12:23:06 -05:00
Zuul 8afe293ba0 Merge "Remove Resource Monitor ; aka rmon, from the load" 2019-03-21 14:11:27 +00:00
Eric MacDonald eca8e103b6 Remove Resource Monitor ; aka rmon, from the load
All rmon resource monitoring has been moved to collectd.

This update removes rmon from mtce and the load.

Story: 2002823
Task: 30045

Test Plan:
PASS: Build and install a standard system.
PASS: Inspect mtce rpm list
PASS: Inspect logs
PASS: Check pmon.d

Change-Id: I1cee4a534171b3c5fa93f3cbc04beaeaf744d161
Signed-off-by: Eric MacDonald <>
2019-03-17 11:45:33 -04:00
Zuul f57e6ab66b Merge "Update py35 jobs to py37" 2019-03-15 12:29:49 +00:00
Dean Troyer c72cf50c08 Update py35 jobs to py37
The upstream OpenStack default node type changed yesterday
from Ubuntu Xenial to Bionic. We have a number of jobs pegged
directly to py35 which is no longer available in Bionic.

We can either pin the py35 jobs to Xenial nodes or update them
to py36 or py37.  OpenStack is supporting both of those for the
Stein release, since StarlingX does not have any position on
Python 3 versions (yet!) I am suggesting we move straight to py37
and in the case of issues now make these jobs non-voting until
any incompatibilities are resolved.

Change-Id: I99b6fdb4fe319e51fc5bf0a2d33e67c57bfec01f
Signed-off-by: Dean Troyer <>
2019-03-14 17:19:36 -05:00
Don Penney 8055fcbe51 Protect against generating empty patch
If a user attempts to generate a patch without specifying
any packages, raise an exception to avoid malformed patches.

Additionally, very small files (like a patch with no packages)
appear to be handled differently by the API handler, passing
a cStringIO object for small files and a file object for files
that are about 1K or larger. For robustness, the upload
handler is updated to do a hasattr('fileno') check in order
to protect against an unhandled exception for small files.

Change-Id: Ie1e730a183a27850ba8567f31aea603459b59d45
Closes-Bug: 1803022
Signed-off-by: Don Penney <>
2019-03-14 17:03:58 -04:00
Zuul 2fc8ef2f21 Merge "Add failure checks to patching init script" 2019-03-13 18:25:14 +00:00
Zuul e2b993901a Merge "Trigger garbage collection to free WSGI resources" 2019-03-13 18:23:56 +00:00
Zuul 0cb5f8e8f4 Merge "Change service dependencies to" 2019-03-11 17:45:58 +00:00
Don Penney ef0398bb7f Add failure checks to patching init script
The sw-patch init script is called by the 'sw-patch install-local'
command with a restart option to trigger the patch-agent to
install patches, as there is no communications between the
patch-agent and patch-controller at this point. However, the
init script was not checking for failures reported by the
patch-agent when it tries to install patches.

In the case of #1819496, the lighttpd server was not running,
due to a temporary config change at the time. As a result, the
patch-agent was unable to communicate with the patching repo,
and failed to install the patch. Because the init script was
not checking for failures, the failure went unreported to the user.

This update adds checks to the sw-patch init script, in order
to report the failure back to the user.

Change-Id: Id8d69bef3a5c6c2f81d56f4b26752d084f9a7ff2
Closes-Bug: 1819496
Signed-off-by: Don Penney <>
2019-03-11 13:28:33 -04:00