Skip to content

Commit

Permalink
Merge pull request #636 from teclator/no_installed
Browse files Browse the repository at this point in the history
Firewalld API: running? return false if the package is not installed
  • Loading branch information
teclator committed Nov 3, 2017
2 parents f808c12 + 36ebb24 commit f38c87b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions library/network/src/lib/y2firewall/firewalld/api.rb
Expand Up @@ -27,6 +27,7 @@

Yast.import "Stage"
Yast.import "Service"
Yast.import "PackageSystem"

module Y2Firewall
class Firewalld
Expand All @@ -45,6 +46,8 @@ class Api

# Map firewalld modes with their command line tools
COMMAND = { offline: "firewall-offline-cmd", running: "firewall-cmd" }.freeze
# FIXME: Do not like to define twice
PACKAGE = "firewalld".freeze

# Determines the mode in which firewalld is running and as consequence the
# command to be used.
Expand Down Expand Up @@ -83,6 +86,7 @@ def permanent?
# @return [Boolean] true if the state is running; false otherwise
def running?
return false if Yast::Stage.initial
return false if !Yast::PackageSystem.Installed(PACKAGE)

state == "running"
end
Expand Down
7 changes: 7 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Nov 3 15:39:25 UTC 2017 - knut.anderssen@suse.com

- Firewalld API: running? return false if the package is not
installed (fate#323460)
- 4.0.13

-------------------------------------------------------------------
Thu Oct 26 09:03:03 UTC 2017 - knut.anderssen@suse.com

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


Name: yast2
Version: 4.0.12
Version: 4.0.13
Release: 0
Summary: YaST2 - Main Package
License: GPL-2.0
Expand Down

0 comments on commit f38c87b

Please sign in to comment.