Skip to content

Commit

Permalink
Merge 6bdad68 into ca521b8
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 29, 2020
2 parents ca521b8 + 6bdad68 commit 48cc315
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
14 changes: 14 additions & 0 deletions library/systemd/src/lib/yast2/systemctl.rb
Expand Up @@ -2,6 +2,10 @@
require "timeout"
require "shellwords"

require "yast"

Yast.import "Systemd"

module Yast2
# Wrapper around `systemctl` command.
# - uses non-interactive flags
Expand Down Expand Up @@ -82,12 +86,22 @@ def target_units
private

def list_unit_files(type: nil)
if !Yast::Systemd.Running
log.info "systemd not running. Returning empty list"
return ""
end

command = " list-unit-files "
command << " --type=#{type.to_s.shellescape} " if type
execute(command).stdout
end

def list_units(type: nil, all: true)
if !Yast::Systemd.Running
log.info "systemd not running. Returning empty list"
return ""
end

command = " list-units "
command << " --all " if all
command << " --type=#{type.to_s.shellescape} " if type
Expand Down
4 changes: 4 additions & 0 deletions library/systemd/test/yast2/systemctl_test.rb
Expand Up @@ -7,6 +7,10 @@ module Yast2
describe Systemctl do
include SystemctlStubs

before do
allow(Yast::Systemd).to receive(:Running).and_return(true)
end

describe ".execute" do
it "returns a struct with command results" do
expect(Yast::SCR).to receive(:Execute).and_return(
Expand Down
6 changes: 6 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 29 13:22:50 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- Speed up run on WSL (bsc#1157575)
- 4.2.61

-------------------------------------------------------------------
Tue Jan 28 08:42:45 UTC 2020 - Ladislav Slezák <lslezak@suse.cz>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 4.2.60
Version: 4.2.61
Release: 0
Summary: YaST2 Main Package
License: GPL-2.0-only
Expand Down

0 comments on commit 48cc315

Please sign in to comment.