Skip to content

Conversation

@wombelix
Copy link
Contributor

@wombelix wombelix commented Jan 1, 2026

What does this PR change?

spacewalk-debug caused cobbler settings.yaml copies in uyuni supportconfig archives to be invalid YAML syntax because of a missing ':' between key/value. This PR changes the relevant sed command to construct valid yaml when replacing the value. Kudos to jirib for reporting the issue and suggesting a solution.

Fixes: #10414

Manual validation

cobbler_example_settings.yaml

allow_duplicate_hostnames: false
auth_token_expiration: 3600
autoinstall_templates_dir: /var/lib/cobbler/templates
boot_loader_conf_template_dir: "/etc/cobbler/boot_loader_conf"
bootloaders_formats:
  aarch64:
    binary_name: grubaa64.efi
  arm:
    binary_name: bootarm.efi
bootloaders_modules:
  - btrfs
  - xfs
syslinux_dir: '@@syslinux_dir@@'
build_reporting_smtp_server: "localhost"
build_reporting_subject: ""
build_reporting_ignorelist: []
cheetah_import_whitelist:
 - "random"
 - "re"
createrepo_flags: "-c cache -s sha"
default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac."
default_template_type: "cheetah"
default_virt_bridge: xenbr0

Behavior with old sed command:

sed 's/^default_password_crypted.*/default_password_crypted <replaced_by_debug_tool>/' cobbler_example_settings.yaml | yq '.default_password_crypted'
Error: bad file '-': yaml: line 21: could not find expected ':'

sed 's/^default_password_crypted.*/default_password_crypted <replaced_by_debug_tool>/' cobbler_example_settings.yaml | grep default_password_crypted
default_password_crypted <replaced_by_debug_tool>

: after default_password_crypted missing, makes the yaml invalid as reported in #10414

Behavior with new sed command (kudos to @jirib):

sed 's/^\(default_password_crypted:\).*/\1 <replaced_by_debug_tool>/' cobbler_example_settings.yaml | yq '.default_password_crypted'
<replaced_by_debug_tool>

sed 's/^\(default_password_crypted:\).*/\1 <replaced_by_debug_tool>/' cobbler_example_settings.yaml | grep default_password_crypted
default_password_crypted: <replaced_by_debug_tool>

: is now there after default_password_crypted, results in valid yaml file.

Codespace

Check if you already have a running container clicking on Running CodeSpace

Create CodeSpace About billing for Github Codespaces CodeSpace Billing Summary CodeSpace Limit

GUI diff

No difference.

Before:

After:

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes

  • DONE

Test coverage

ℹ️ If a major new functionality is added, it is strongly recommended that tests for the new functionality are added to the Cucumber test suite

  • No tests: Don't see that spacewalk-debug is covered by unit tests

  • DONE

Links

Issue(s): #10414

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "frontend_checks"
  • Re-run test "spacecmd_unittests"

Before you merge

Check How to branch and merge properly!

@wombelix wombelix force-pushed the fix_10414_default_password_crypted-replacement-breaks-yaml branch from 1c271a2 to c3f980d Compare January 1, 2026 19:23
Caused cobbler settings.yaml copies in uyuni supportconfig archives
to be invalid YAML syntax because of a missing ':' between key/value

Fixes: uyuni-project#10414

Co-authored-by: jirib <jirib79@gmail.com>
Signed-off-by: Dominik Wombacher <dominik@wombacher.cc>
@wombelix wombelix force-pushed the fix_10414_default_password_crypted-replacement-breaks-yaml branch from c3f980d to cfe759c Compare January 1, 2026 19:33
Copy link
Member

@rjmateus rjmateus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thank you for this contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

default_password_crypted replacement breaks YAML syntax of settings.yaml

2 participants