From 7cd96355371e5c9250e0e344c07461ab9529a011 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 1 Jul 2024 09:31:14 +0200 Subject: [PATCH] Fix 'linkpac' command crash when used with '--disable-build' or '--disable-publish' option --- behave/features/linkpac.feature | 28 ++++++++++++++++++++++++++++ osc/core.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/behave/features/linkpac.feature b/behave/features/linkpac.feature index 4a235a9a..52805f62 100644 --- a/behave/features/linkpac.feature +++ b/behave/features/linkpac.feature @@ -6,6 +6,34 @@ Background: Given I set working directory to "{context.osc.temp}" +@destructive +Scenario: Run `osc linkpac` + When I execute osc with args "linkpac test:factory/test-pkgA home:Admin" + Then the exit code is 0 + And I execute osc with args "api /source/home:Admin/test-pkgA/_link" + And stdout contains "" + + +@destructive +Scenario: Run `osc linkpac --disable-build` + When I execute osc with args "linkpac test:factory/test-pkgA home:Admin --disable-build" + Then the exit code is 0 + And I execute osc with args "api /source/home:Admin/test-pkgA/_link" + And stdout contains "" + And I execute osc with args "api /source/home:Admin/test-pkgA/_meta" + And stdout contains "\s*\s*" + + +@destructive +Scenario: Run `osc linkpac --disable-publish` + When I execute osc with args "linkpac test:factory/test-pkgA home:Admin --disable-publish" + Then the exit code is 0 + And I execute osc with args "api /source/home:Admin/test-pkgA/_link" + And stdout contains "" + And I execute osc with args "api /source/home:Admin/test-pkgA/_meta" + And stdout contains "\s*\s*" + + @destructive Scenario: Run `osc linkpac on a locked package` Given I execute osc with args "lock test:factory/test-pkgA" diff --git a/osc/core.py b/osc/core.py index 6394fe25..cf09ad4f 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3294,7 +3294,7 @@ def link_pac( if disable_build or disable_publish: meta_change = True - root = ET.fromstring(b"".join(dst_meta)) + root = ET.fromstring("".join(dst_meta)) if disable_build: elm = root.find('build')