mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
ci: Implement 'list-images' helper action
This simply calls the underlying Makefile target. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
06cb54f36b
commit
2481ad1125
21
ci/helper
21
ci/helper
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import pty
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -29,6 +30,13 @@ class Parser:
|
|||||||
)
|
)
|
||||||
subparsers.required = True
|
subparsers.required = True
|
||||||
|
|
||||||
|
# list-images action
|
||||||
|
listimagesparser = subparsers.add_parser(
|
||||||
|
"list-images",
|
||||||
|
help="list known container images",
|
||||||
|
)
|
||||||
|
listimagesparser.set_defaults(func=Application.action_list_images)
|
||||||
|
|
||||||
# refresh action
|
# refresh action
|
||||||
refreshparser = subparsers.add_parser(
|
refreshparser = subparsers.add_parser(
|
||||||
"refresh",
|
"refresh",
|
||||||
@ -50,6 +58,16 @@ class Application:
|
|||||||
if not shutil.which(self.args.lcitool):
|
if not shutil.which(self.args.lcitool):
|
||||||
sys.exit("error: 'lcitool' not installed")
|
sys.exit("error: 'lcitool' not installed")
|
||||||
|
|
||||||
|
def make_run(self, target):
|
||||||
|
args = [
|
||||||
|
"-C",
|
||||||
|
self.basedir,
|
||||||
|
target,
|
||||||
|
]
|
||||||
|
|
||||||
|
if pty.spawn(["make"] + args) != 0:
|
||||||
|
sys.exit("error: 'make' failed")
|
||||||
|
|
||||||
def lcitool_run(self, args):
|
def lcitool_run(self, args):
|
||||||
output = subprocess.check_output([self.args.lcitool] + args)
|
output = subprocess.check_output([self.args.lcitool] + args)
|
||||||
return output.decode("utf-8")
|
return output.decode("utf-8")
|
||||||
@ -126,6 +144,9 @@ class Application:
|
|||||||
|
|
||||||
self.generate_vars(host)
|
self.generate_vars(host)
|
||||||
|
|
||||||
|
def action_list_images(self):
|
||||||
|
self.make_run(f"ci-list-images")
|
||||||
|
|
||||||
def action_refresh(self):
|
def action_refresh(self):
|
||||||
self.refresh_containers()
|
self.refresh_containers()
|
||||||
self.refresh_cirrus()
|
self.refresh_cirrus()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user