diff --git a/ctdb/config/events/legacy/50.samba.script b/ctdb/config/events/legacy/50.samba.script index 44ae0a4e63b..84600e25024 100755 --- a/ctdb/config/events/legacy/50.samba.script +++ b/ctdb/config/events/legacy/50.samba.script @@ -109,21 +109,24 @@ testparm_background_update() testparm_foreground_update "$_timeout" >/dev/null 2>&1 /dev/null + _param="$1" + + sed -n \ + -e "s|^[[:space:]]*${_param}[[:space:]]*=[[:space:]]\(..*\)|\1|p" \ + "$smbconf_cache" + } list_samba_shares() { - testparm_cat | - sed -n -e 's@^[[:space:]]*path[[:space:]]*=[[:space:]]@@p' | - sed -e 's/"//g' + testparm_get "path" | sed -e 's/"//g' } list_samba_ports() { - testparm_cat --parameter-name="smb ports" + testparm_get "smb ports" } ########################### diff --git a/ctdb/tests/UNIT/eventscripts/50.samba.monitor.111.sh b/ctdb/tests/UNIT/eventscripts/50.samba.monitor.111.sh index 55df6da807e..d72855f2291 100755 --- a/ctdb/tests/UNIT/eventscripts/50.samba.monitor.111.sh +++ b/ctdb/tests/UNIT/eventscripts/50.samba.monitor.111.sh @@ -10,7 +10,7 @@ ok_null simple_test export FAKE_TESTPARM_FAIL="yes" -required_result 1 <