Permalink
Browse files

Update calls to yast2 systemd services (#20)

* Update calls to Yast2::Systemd::Service

* Update yast2 dependency

* Update version and changelog
  • Loading branch information...
dgdavid committed Aug 23, 2018
1 parent a8264dc commit a421f2fed9fb16b49c603a1309aa42af01ca190f
Showing with 15 additions and 8 deletions.
  1. +6 −0 package/yast2-sysconfig.changes
  2. +3 −2 package/yast2-sysconfig.spec
  3. +3 −3 src/modules/Sysconfig.rb
  4. +3 −3 test/sysconfig_test.rb
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 23 14:34:31 UTC 2018 - dgonzalez@suse.com

- Update calls to Yast2 systemd classes (related to #319428)
- 4.1.0

-------------------------------------------------------------------
Wed Aug 22 14:50:06 CEST 2018 - schubi@suse.de

@@ -17,7 +17,7 @@


Name: yast2-sysconfig
Version: 4.0.1
Version: 4.1.0
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -30,7 +30,8 @@ BuildRequires: yast2-devtools >= 3.1.10
# path_matching (RSpec argument matcher)
BuildRequires: yast2-ruby-bindings >= 3.1.31
Requires: perl
Requires: yast2 >= 2.21.22
# Yast2::Systemd::Service
Requires: yast2 >= 4.1.3

# For tests
BuildRequires: ruby
@@ -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 a421f2f

Please sign in to comment.