update/software
Heitor Matsui 771bddb266 Create wrapper class to run commands via subprocess
This commit creates a class to wrap the main subprocess
commands used by USM, that are 'run', 'check_output' and
'check_call' so that their returned information is logged
into a json file. The purpose of this file is to enable
each deployment history to be recovered in an easier way
on the future.

The json files are stored inside directories named under
the corresponding release, and have a file named under the
deployment stage in which the object was instantiated, e.g.:

/opt/software/summary/starlingx_24.03.0/deploy_precheck.json

These files can grow incrementally in case multiple commands
are executed under the same deployment stage.

The wrapper functions have the same name as the ones from
the 'subprocess' library and behave exactly the same way.

The subprocess functions used on the code currenly will be
replaced by a follow-up commit.

Test Plan
PASS: manually replace subprocess functions on USM code, run
      the respective commands and verify:
      - Command is executed successfully
      - Output and behavior is maintained
      - The json file is created with the expected directory,
        filename and content

Story: 2010676
Task: 48955

Change-Id: Iccf1aef1b0cc064399163eeb58c23fa065a6dab5
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2023-10-19 09:54:51 -03:00
..
debian Build Software Client python wheels package 2023-10-05 20:16:14 +00:00
scripts Create platform upgrade health plugin 2023-07-28 09:23:45 -03:00
service-files Build Software Client python wheels package 2023-10-05 20:16:14 +00:00
software Create wrapper class to run commands via subprocess 2023-10-19 09:54:51 -03:00
.coveragerc Upload skeleton for unified software management 2023-04-03 14:03:04 +00:00
Hacking.rst Upload skeleton for unified software management 2023-04-03 14:03:04 +00:00
LICENSE Upload skeleton for unified software management 2023-04-03 14:03:04 +00:00
README.rst Upload skeleton for unified software management 2023-04-03 14:03:04 +00:00
pylint.rc Setup controller and agent processes for "software" 2023-04-20 19:22:30 +00:00
requirements.txt Bash completion for USM 2023-08-03 16:21:00 +00:00
setup.cfg Build Software Client python wheels package 2023-10-05 20:16:14 +00:00
setup.py Bash completion for USM 2023-08-03 16:21:00 +00:00
test-requirements.txt Upload skeleton for unified software management 2023-04-03 14:03:04 +00:00
tox.ini Convert software CLI commands to argparse 2023-05-05 14:23:03 +00:00

README.rst

software

StarlingX Unified Software Delivery and Management