lib/teuton/case_manager/case/builtin/service.rb in teuton-2.1.10 vs lib/teuton/case_manager/case/builtin/service.rb in teuton-2.1.11

- old
+ new

@@ -1,32 +1,33 @@ class Service - attr_accessor :param - - def initialize(parent) - @parent = parent + def initialize(teuton_host, param) + @teuton_host = teuton_host + @parent = teuton_host.parent + @host = teuton_host.host + @param = param end def is_running? @parent.target("Service #{@param} is running?") - @parent.run "systemctl status #{@param}" + @parent.run "systemctl status #{@param}", on: @host @parent.expect_one ['Active:', 'running' ] end def is_inactive? @parent.target("Service #{@param} is inactive?") - @parent.run "systemctl status #{@param}" + @parent.run "systemctl status #{@param}", on: @host @parent.expect_one ['Active:', 'inactive' ] end def is_enable? @parent.target("Service #{@param} is enable?") - @parent.run "systemctl status #{@param}" + @parent.run "systemctl status #{@param}", on: @host @parent.expect_one ['Loaded:', 'enable' ] end def is_disable? @parent.target("Service #{@param} is disable?") - @parent.run "systemctl status #{@param}" + @parent.run "systemctl status #{@param}", on: @host @parent.expect_one ['Loaded:', 'disable' ] end end