Skip to content
Permalink
Browse files

Update calls to Yast2::Systemd::Service

  • Loading branch information...
dgdavid committed Aug 16, 2018
1 parent 5c603b0 commit 17d47f57e2a9643477f087a5ab295066ab05aa88
Showing with 6 additions and 6 deletions.
  1. +3 −3 src/modules/Sysconfig.rb
  2. +3 −3 test/sysconfig_test.rb
@@ -10,6 +10,7 @@
# Representation of the configuration of sysconfig.
# Input and output routines.
require "yast"
require "yast2/systemd/service"

module Yast
class SysconfigClass < Module
@@ -28,7 +29,6 @@ def main
Yast.import "String"
Yast.import "Service"
Yast.import "Mode"
Yast.import "SystemdService"


@configfiles = [
@@ -1166,7 +1166,7 @@ def exec_service_action(name, type = :reload)

action = lambda do
log.info "Service #{name} will be restarted (#{type})"
service = SystemdService.find(name)
service = Yast2::Systemd::Service.find(name)
return false unless service
service.send(type)
end
@@ -1180,7 +1180,7 @@ def exec_service_action(name, type = :reload)
# @param service name
# @return [Boolean] active?
def service_active?(service_name)
service_unit = SystemdService.find(service_name)
service_unit = Yast2::Systemd::Service.find(service_name)

unless service_unit
Report.Error(
@@ -1,9 +1,9 @@
#!/usr/bin/env rspec

require_relative 'test_helper'
require "yast2/systemd/service"

Yast.import "Sysconfig"
Yast.import "SystemdService"

describe Yast::Sysconfig do
subject(:sysconfig) do
@@ -183,7 +183,7 @@
allow(Yast::SCR).to receive(:Write).with(path_matching(/^\.syseditor/), anything)

service = double("postfix_service")
allow(Yast::SystemdService).to receive(:find).with("postfix").and_return service
allow(Yast2::Systemd::Service).to receive(:find).with("postfix").and_return service
expect(service).to receive(:active?).and_return true
expect(service).to receive(:restart)

@@ -195,7 +195,7 @@
allow(Yast::SCR).to receive(:Write).with(path_matching(/^\.syseditor/), anything)

service = double("postfix_service")
allow(Yast::SystemdService).to receive(:find).with("postfix").and_return service
allow(Yast2::Systemd::Service).to receive(:find).with("postfix").and_return service
expect(service).to receive(:active?).and_return true
expect(service).to receive(:reload)

0 comments on commit 17d47f5

Please sign in to comment.
You can’t perform that action at this time.