From 47220501e9dd179b1a6dda43a4f99804e0a2c8c2 Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Wed, 4 Feb 2015 11:59:15 +0100 Subject: [PATCH] Use the correct location for ypdomainname (bnc#916031) * It's actually placed in /usr/bin for SLE12, openSUSE13.2 and Factory. * The old location works in SLE12 and 13.2 because there is still a symlink added for compatibility (that would be removed at some point) --- src/modules/Nis.rb | 6 ++---- testsuite/tests/readwrite.out | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/modules/Nis.rb b/src/modules/Nis.rb index 688b6eb..d5b0023 100644 --- a/src/modules/Nis.rb +++ b/src/modules/Nis.rb @@ -908,10 +908,8 @@ def Read @multidomain_broadcast = {} if @multidomain_broadcast == nil @slp_domain = {} if @slp_domain == nil - out = Convert.to_map( - SCR.Execute(path(".target.bash_output"), "/bin/ypdomainname") - ) - @domain = Builtins.deletechars(Ops.get_string(out, "stdout", ""), "\n") + out = SCR.Execute(path(".target.bash_output"), "/usr/bin/ypdomainname") + @domain = out["stdout"].strip @old_domain = @domain @dhcpcd_running = SCR.Execute( diff --git a/testsuite/tests/readwrite.out b/testsuite/tests/readwrite.out index 5a63ce3..fb6395f 100644 --- a/testsuite/tests/readwrite.out +++ b/testsuite/tests/readwrite.out @@ -1,7 +1,7 @@ Dump no policy Read .sysconfig.network.config.NETCONFIG_NIS_POLICY "" Dir .sysconfig.network.config: ["NETCONFIG_NIS_POLICY"] -Execute .target.bash_output "/bin/ypdomainname" $["exit":0, "stderr":"", "stdout":"mydomain\n"] +Execute .target.bash_output "/usr/bin/ypdomainname" $["exit":0, "stderr":"", "stdout":"mydomain\n"] Execute .target.bash "ls /var/run/dhcpcd-*.pid" 0 Read .sysconfig.ypbind.YPBIND_LOCAL_ONLY "no" Read .sysconfig.ypbind.YPBIND_BROADCAST "no" @@ -27,7 +27,7 @@ Return true Dump auto policy Read .sysconfig.network.config.NETCONFIG_NIS_POLICY "auto" Dir .sysconfig.network.config: ["NETCONFIG_NIS_POLICY"] -Execute .target.bash_output "/bin/ypdomainname" $["exit":0, "stderr":"", "stdout":"mydomain\n"] +Execute .target.bash_output "/usr/bin/ypdomainname" $["exit":0, "stderr":"", "stdout":"mydomain\n"] Execute .target.bash "ls /var/run/dhcpcd-*.pid" 0 Read .sysconfig.ypbind.YPBIND_LOCAL_ONLY "no" Read .sysconfig.ypbind.YPBIND_BROADCAST "no"