Skip to content

Commit

Permalink
Add openqa_cli property to xml
Browse files Browse the repository at this point in the history
The idea is that some projects can put custom wrapper
instead of openqa-cli calls.
That wrapper can manage generated parameters as needed,
make additional calls, etc.
  • Loading branch information
andrii-suse committed Jul 25, 2024
1 parent 814897d commit 49f9a5d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions script/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def openqa_call_start_meta_variables(meta_variables):
def pre_openqa_call_start(repos):
return ''

openqa_call_start = lambda distri, version, archs, staging, news, news_archs, flavor_distri, meta_variables, assets_flavor, repo0folder: '''
openqa_call_start = lambda distri, version, archs, staging, news, news_archs, flavor_distri, meta_variables, assets_flavor, repo0folder, openqa_cli: '''
archs=(ARCHITECTURS)
[ ! -f __envsub/files_repo.lst ] || ! grep -q -- "-POOL-" __envsub/files_repo.lst || additional_repo_suffix=-POOL
Expand Down Expand Up @@ -252,7 +252,7 @@ def pre_openqa_call_start(repos):
''' + openqa_call_news(news, news_archs) + '''
}
fi
echo "/usr/bin/openqa-cli api -X post isos?async=1 \\\\\"
echo "''' + openqa_cli + ''' \\\\\"
(
echo \" DISTRI=$distri \\\\
ARCH=$arch \\\\
Expand Down
5 changes: 5 additions & 0 deletions script/scriptgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self, envdir, project, productpath, version, brand):
self.brand = brand
self.envdir = os.path.join(envdir, project)
self.distri = ""
self.openqa_cli = "/usr/bin/openqa-cli api -X post isos?async=1"
self.version = version
self.batches = []
project = project.split("::")[0]
Expand Down Expand Up @@ -64,6 +65,8 @@ def doFile(self, filename):
if root.attrib.get("distri", ""):
self.distri = root.attrib["distri"]

self.openqa_cli = root.attrib.get("openqa_cli", self.openqa_cli)

for t in root.findall(".//batch"):
batch = self.doBatch(t)
if batch:
Expand Down Expand Up @@ -955,6 +958,7 @@ def gen_print_openqa(self, f):
self.meta_variables,
self.assets_flavor,
self.repo0folder,
self.ag.openqa_cli,
),
f,
"| grep $arch | head -n 1",
Expand All @@ -973,6 +977,7 @@ def gen_print_openqa(self, f):
self.meta_variables,
self.assets_flavor,
self.repo0folder,
self.ag.openqa_cli,
),
f,
)
Expand Down
2 changes: 1 addition & 1 deletion t/abs/Test1/print_openqa.before
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/usr/bin/openqa-cli api -X post isos?async=1 \
echo \
ARCH=x86_64 \
ASSET_256=my-iso.x86_64-1.1.1-Build1.111.iso.sha256 \
BUILD=1.111 \
Expand Down
2 changes: 1 addition & 1 deletion xml/abs/Test.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<openQA project_pattern="Test(?P&lt;version&gt;[1-9])" dist_path="test1">
<openQA project_pattern="Test(?P&lt;version&gt;[1-9])" dist_path="test1" openqa_cli="echo">
<flavor name="FLAVOR" distri="distri" iso="iso"/>
</openQA>

0 comments on commit 49f9a5d

Please sign in to comment.