diff --git a/hawk/app/lib/crm_script.rb b/hawk/app/lib/crm_script.rb index db8ee627..85ca94df 100644 --- a/hawk/app/lib/crm_script.rb +++ b/hawk/app/lib/crm_script.rb @@ -45,7 +45,7 @@ def run(jsondata) tmpf = Tempfile.new 'crmscript' tmpf.write("script json \"#{cmd}\"") tmpf.close - cmdline = ['crm', '-f', tmpf.path] + cmdline = ['/usr/sbin/crm', '-f', tmpf.path] old_home = Util.ensure_home_for(user) out, err, status = Util.capture3(*cmdline) tmpf.unlink diff --git a/hawk/app/lib/hb_report.rb b/hawk/app/lib/hb_report.rb index 7e125a7c..72c7b144 100644 --- a/hawk/app/lib/hb_report.rb +++ b/hawk/app/lib/hb_report.rb @@ -115,7 +115,7 @@ def generate(from_time, to_time, all_nodes = true) args.push("-Q") # Requires a version of crm report which supports this args.push("-S") unless all_nodes args.push(@path) - out, err, status = Util.capture3('crm', "report", *args) + out, err, status = Util.capture3('/usr/sbin/crm', "report", *args) f = File.new(@outfile, "w") f.write(out) f.close diff --git a/hawk/app/lib/invoker.rb b/hawk/app/lib/invoker.rb index 2f6f914b..b948346b 100644 --- a/hawk/app/lib/invoker.rb +++ b/hawk/app/lib/invoker.rb @@ -62,7 +62,7 @@ def crm_configure_load_update(cmd) begin f << cmd f.close - CrmEvents.instance.push "crm configure\n#{cmd}\n" unless @no_log + CrmEvents.instance.push "/usr/sbin/crm configure\n#{cmd}\n" unless @no_log result = crm '-F', 'configure', 'load', 'update', f.path ensure f.unlink @@ -73,7 +73,7 @@ def crm_configure_load_update(cmd) # Invoke cibadmin with command line arguments. Returns stdout as string, # Raises NotFoundError, SecurityError or RuntimeError on failure. def cibadmin(*cmd) - out, err, status = Util.run_as(current_user, current_pass, 'cibadmin', *cmd) + out, err, status = Util.run_as(current_user, current_pass, '/usr/sbin/cibadmin', *cmd) case status.exitstatus when 0 return out @@ -89,23 +89,23 @@ def cibadmin(*cmd) # Invoke "cibadmin -p --replace" def cibadmin_replace(xml) - CrmEvents.instance.push "cibadmin -p --replace </dev/null') + nvpair = Util.safe_x("CIB_file=\"#{path}\"", '/usr/sbin/cibadmin', '-Q', '--xpath', "/cib/configuration//crm_config//nvpair[@name='dc-version']", '2>/dev/null') m = nvpair.match(/value="([^"]+)"/) return nil unless m m[1] @@ -144,7 +144,7 @@ def graph(hb_report, path, format = :svg) require "tempfile" tmpfile = Tempfile.new("hawk_dot") tmpfile.close - _out, err, status = Util.capture3('crm_simulate', '-x', tpath.to_s, format == :xml ? "-G" : "-D", tmpfile.path.to_s) + _out, err, status = Util.capture3('/usr/sbin/crm_simulate', '-x', tpath.to_s, format == :xml ? "-G" : "-D", tmpfile.path.to_s) rc = status.exitstatus ret = [false, err] diff --git a/hawk/app/models/wizard.rb b/hawk/app/models/wizard.rb index 71671c4b..3e245631 100644 --- a/hawk/app/models/wizard.rb +++ b/hawk/app/models/wizard.rb @@ -72,7 +72,7 @@ def verify(params) end def command_string - base = ["crm", "script", "run", @name] + base = ["/usr/sbin/crm", "script", "run", @name] @params.each do |k, v| if v.is_a? Hash v.each do |kk, vv|