Skip to content

Commit ecf9901

Browse files
Yet another crash fix for new schema handling
1 parent aa03ca4 commit ecf9901

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/productcomposer/createartifacts/createtree.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def create_tree(outdir, product_base_dir, yml, pool, flavor, tree_report, suppor
160160
create_updateinfo_xml(maindir, yml, pool, flavor, debugdir, sourcedir)
161161

162162
# Add License File and create extra .license directory
163-
if yml['iso'] and yml['iso'].get('tree', None) != 'drop':
163+
if yml['iso'] and yml['iso'].tree != 'drop':
164164
licensefilename = '/license.tar'
165165
if os.path.exists(maindir + '/license-' + yml['name'] + '.tar') or os.path.exists(maindir + '/license-' + yml['name'] + '.tar.gz'):
166166
licensefilename = '/license-' + yml['name'] + '.tar'
@@ -210,15 +210,15 @@ def create_tree(outdir, product_base_dir, yml, pool, flavor, tree_report, suppor
210210
# presumably you wouldn't need a bootable iso for source and
211211
# debuginfo packages.
212212
if yml['iso']:
213-
if workdir == maindir and yml['iso']['base']:
213+
if workdir == maindir and yml['iso'].base:
214214
agama_arch = yml['architectures'][0]
215215
note(f"Export main tree into agama iso file for {agama_arch}")
216216
create_agama_iso(outdir, yml['iso'], yml['build_options'], pool, workdir, application_id, agama_arch)
217217
else:
218218
create_iso(outdir, yml['iso'], workdir, application_id)
219219

220220
# cleanup
221-
if yml['iso']['tree'] == 'drop':
221+
if yml['iso'].tree == 'drop':
222222
shutil.rmtree(workdir)
223223

224224
# create SBOM data

src/productcomposer/parsers/yamlparser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from ..utils.loggerutils import die
77
from ..verifiers.composeschema import ComposeSchema
8-
8+
from ..verifiers.composeschema import compose_schema_iso
99

1010

1111
def parse_yaml(filename: str, flavor: str | None) -> Dict[str, any]:
@@ -60,8 +60,8 @@ def parse_yaml(filename: str, flavor: str | None) -> Dict[str, any]:
6060
for tag in ('volume_id', 'publisher', 'tree', 'base'):
6161
if f['iso'].get(tag, None):
6262
if not yml['iso']:
63-
yml['iso'] = {}
64-
yml['iso'][tag] = f['iso'][tag]
63+
yml['iso'] = compose_schema_iso()
64+
exec("yml['iso']." + tag + " = f['iso'][tag]")
6565

6666
for tag in (
6767
'installcheck',

0 commit comments

Comments
 (0)