Commit Graph

22 Commits

Author SHA1 Message Date
Takashi Kajinami 4b510162e5 Vendor dib-run-parts
The dib-utils repository was retired as part of retirement of TripleO.
This imports the tiny dib-run-parts script because it's used by
os-refresh-config now.

This also removes direct execution of os_refresh_config.py, which is
required only for testing.

Change-Id: Ia516e604bafdc59dbcfa81796348191b03cbe0b7
2024-02-29 17:49:13 +09:00
Takashi Kajinami e3dab50e44 Revert "Drop direct execution of os_refresh_config.py"
This reverts commit d262d5e60e.

Reason for revert:
This breaks unit tests execution during packaging process in  RDO.
Until we find out the root cause, let's revert the change.

Change-Id: I061b388c7df67422ded99dbf1bfe4c6fb2719f9c
2024-01-30 01:31:11 +09:00
Takashi Kajinami d262d5e60e Drop direct execution of os_refresh_config.py
Now we generate the console script using setuptools, and we don't
expect users may directly execute the *.py file.

Change-Id: I6fb802d0dee7e47f9fd619afba2f379f881914af
2024-01-29 23:50:35 +09:00
Zuul b3b189c3ae Merge "Fix python shebang" 2023-12-14 06:57:08 +00:00
Takashi Kajinami 6cd51c6f79 Remove logic for psutil < 2.0
... because the minimum version is now 3.2.2.

Also the children method returns a list so we don't have to cast it
to a list explicitly.

Change-Id: I59c1a7847c5b4cc8471884671e57f3e49e4573d8
2023-11-28 00:49:31 +09:00
Takashi Kajinami 13c189b236 Fix python shebang
The current shebang requires /usr/bin/python which is not available in
Ubuntu Jammy by default.

Change-Id: I13b782ef761c7cd310fca62ab11c7b50023f94f5
2023-10-18 10:40:35 +00:00
Marios Andreou a0322979f9 Remove tripleo-multinode-container-minimal from layout + fix test
The tripleo-multinode-container-minimal is being deprecated [1]
as part of wider tripleo CI optimization at [2].

This updates test-requirements to fix issue seen in [3] and also
fixes a failing pep8 test seen after test-requirements was fixed.

[1] Ie6473759383bd4b903cbe56fba9fee75a24154c4
[2] https://review.opendev.org/q/topic:tripleo-ci-reduce
[3] https://a28720641abd1053931d-69746c322fe5e3cf8e2976f654b96d92.ssl.cf5.rackcdn.com/777098/1/check/openstack-tox-py38/9e6a3c0/tox/py38-1.log

Change-Id: I6df7ef9eacc25435e797005ad8f764c3e0913d46
2021-02-25 18:41:49 +02:00
Sean McGinnis b324bcece1 Use unittest.mock instead of third party mock
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: I7a6bea2e6e6fffcc262dd4241a7d6b75913d87aa
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-13 19:48:55 +00:00
Dirk Mueller e1e0ef0916 Adjust test suite for new psutil versions
psutil 2.x and above has a lot of API changes as described in:
https://github.com/giampaolo/psutil/blob/master/HISTORY.rst

So we should work correctly with both old and new psutil
versions by using a version check and use the correct
method/attributes. This allows to eventually unlift the version
cap that starts to hurt.

Change-Id: I6b6682e3af34f43da4e397d602e9ee4e1c83970f
Related-Bug: 1645918
2017-01-18 20:19:36 +01:00
Steve Baker 1d828fa0dd Implement a --timeout for killing stalled scripts
This implements the feature required for bug #1595722 but the tripleo
bug is not closed until os-refresh-config is invoked with an
appropriate --timeout value.

Change-Id: Ibcbb2090aed126abec8dac49efa53ecbdb2b9b2c
DependsOn: If31f0d5d60e8585720c4c9c95cffa202f059f6f7
Partial-Bug: #1595722
2016-07-04 16:51:56 +12:00
Steve Baker d0cf563c2d Functional test which executes os-refresh-config
This provides functional test coverage for executing
os_refresh_config.py as a separate process.

dib-utils is added as a dependency since os-refresh-config depends on
dib-run-parts being available.

Change-Id: Ibc6232d8c1c64f660b9f86feb8b80e25ab5794d3
Related-Bug: #1595722
2016-07-01 12:55:49 +12:00
Jenkins c7544b56df Merge "Use FHS-compliant default base directory" 2014-05-09 11:24:56 +00:00
Ben Nemec 2d1397b468 Use FHS-compliant default base directory
/opt/stack as the default base directory is not very friendly to
non-OpenStack users, so this changes the default base directory
to reside in /usr/libexec.  The /opt/stack path will continue to
work for now so any existing users will not be broken by the change.

Also changes the directory name from os-config-refresh to
os-refresh-config to better align with the os-apply-config naming.

Change-Id: I98e93d91685ae25ae74a5470483a1cc8b97da4e5
2014-05-06 15:24:48 +00:00
Clint Byrum 64d3619302 Add error handler to os-refresh-config
Previously on error the program simply exitted. This will allow script
writers to write error handlers to be called whenever any phase fails.

Change-Id: I3f8025663700192e9d8132a0e9122b4e0085ebbd
2014-04-11 15:31:36 -07:00
Clint Byrum fd60517cb8 Add basic unit tests
There were none before this. Adding this test exposed a coding error in
the main method (returned None instead of 0)

Change-Id: Ibf6bf8276a96fceebd9f71773209452f786d0ef7
2014-04-11 15:31:09 -07:00
Clint Byrum 8e73c9226c Move migration to run after post-configure
This change has been discussed and planned for a while. We have not used
migrations much in TripleO, so it was not clear that it was necessary.
But as we move to HA deployments we need a way to run scripts after the
system state has been asserted, which is what migration is for.

Change-Id: I16d90abb3fccc791001beb5d8ed267fcd00f820c
2014-02-07 12:15:49 -08:00
Clint Byrum d7ea66ee8d Add a lockfile.
The scripts run by os-refresh-config generally expect to be running
only once. This will ensure that. Because we use /var/run, this also
now assumes that os-refresh-config is run by root. Otherwise one must
pass in a different --lockfile path.

Change-Id: I33cbb065d6bc32c87f5e72132fceef9df82a190d
2013-07-17 09:00:18 -07:00
Lucas Alvares Gomes d8c7de3d8b Use dib-run-parts.
dib-run-parts is simpler and gives us profiling data. The --list option
was removed because it's not yet supported.

Change-Id: Icab4c5c04a26572e9b8564a25b1a328c889ead1c
2013-06-13 09:56:41 +01:00
Lucas Alvares Gomes 91f75348fb Add tox.ini and fix pep8 problems
Change-Id: I42f6ed2fbf211e7ac6adcd8e40ce29ec8c7c5c5c
2013-06-13 09:50:52 +01:00
Tim Miller d6a21d4d42 Add default argument of sys.argv to main() 2013-02-14 11:18:43 -08:00
Tim Miller 14563b4099 add __init__.py, bump version 2013-02-14 10:55:03 -08:00
Clint Byrum b56af9fee9 Make more pythonic 2013-02-12 07:20:12 -08:00