Skip to content

Commit

Permalink
Merge pull request uyuni-project#474 from cbosdo/suma-version-inspect
Browse files Browse the repository at this point in the history
Fix the SUSE Manager version inspection before release
  • Loading branch information
cbosdo authored Oct 30, 2024
2 parents 0526859 + 7bac1bb commit afcc02c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shared/utils/serverinspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewServerInspector(scriptDir string) ServerInspector {
"cat /etc/*release | grep 'Uyuni release' | cut -d ' ' -f3 || true"),
types.NewInspectData(
"suse_manager_release",
"sed 's/.*(\\([0-9.]*\\)).*/\\1/g' /etc/susemanager-release || true"),
"sed 's/.*(\\([0-9.]\\+\\).*/\\1/g' /etc/susemanager-release || true"),
types.NewInspectData(
"fqdn",
"cat /etc/rhn/rhn.conf 2>/dev/null | grep 'java.hostname' | cut -d' ' -f3 || true"),
Expand Down
2 changes: 1 addition & 1 deletion shared/utils/serverinspector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestServerInspectorGenerate(t *testing.T) {
expected := `#!/bin/bash
# inspect.sh, generated by mgradm
echo "uyuni_release=$(cat /etc/*release | grep 'Uyuni release' | cut -d ' ' -f3 || true)" >> ` + dataPath + `
echo "suse_manager_release=$(sed 's/.*(\([0-9.]*\)).*/\1/g' /etc/susemanager-release || true)" >> ` + dataPath + `
echo "suse_manager_release=$(sed 's/.*(\([0-9.]\+\).*/\1/g' /etc/susemanager-release || true)" >> ` + dataPath + `
echo "fqdn=$(cat /etc/rhn/rhn.conf 2>/dev/null | grep 'java.hostname' | cut -d' ' -f3 || true)" >> ` + dataPath + `
echo "image_pg_version=$(rpm -qa --qf '%{VERSION}\n' 'name=postgresql[0-8][0-9]-server' | cut -d. -f1 | sort -n | tail -1 || true)" >> ` + dataPath + `
echo "current_pg_version=$((test -e /var/lib/pgsql/data/PG_VERSION && cat /var/lib/pgsql/data/PG_VERSION) || true)" >> ` + dataPath + `
Expand Down
2 changes: 2 additions & 0 deletions uyuni-tools.changes.cbosdo.suma-version-inspect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix the SUSE Manager version detection with pre-release
milestones

0 comments on commit afcc02c

Please sign in to comment.