Skip to content

Commit

Permalink
Make rubocop happy
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 5, 2018
1 parent 8fa6aef commit 3491000
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/lib/y2firewall/proposal_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def initialize

load_features
enable_firewall! if @enable_firewall
enable_sshd! if Yast::Linuxrc.usessh || only_public_key_auth || @enable_sshd
open_ssh! if Yast::Linuxrc.usessh || only_public_key_auth || @open_ssh
open_vnc! if Yast::Linuxrc.vnc
enable_sshd! if wanted_enable_sshd?
open_ssh! if wanted_open_ssh?
open_vnc! if wanted_open_vnc?
# FIXME: obtain from Y2Firewall::Firewalld, control file or allow to
# chose a different one in the proposal
@default_zone = "public"
Expand Down Expand Up @@ -133,6 +133,18 @@ def global_section
Yast::ProductFeatures.GetSection("globals")
end

def wanted_enable_sshd?
Yast::Linuxrc.usessh || only_public_key_auth || @enable_sshd
end

def wanted_open_ssh?
Yast::Linuxrc.usessh || only_public_key_auth || @open_ssh
end

def wanted_open_vnc?
Yast::Linuxrc.vnc
end

# Determines whether only public key authentication is supported
#
# @note If the root user does not have a password, we assume that we will use a public
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def stub_module(name, fake_class = nil)

# stub classes from other modules to speed up a build
stub_module("AutoInstall")
# rubocop:disable Style/SingleLineMethods
# rubocop:disable Style/MethodName
stub_module("UsersSimple", Class.new { def self.GetRootPassword; "secret"; end })

# some tests have translatable messages
Expand Down

0 comments on commit 3491000

Please sign in to comment.