Skip to content

Commit

Permalink
Rely on wicked to modify interfaces zones
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Nov 24, 2017
1 parent f4866d1 commit 09d668c
Showing 1 changed file with 16 additions and 51 deletions.
67 changes: 16 additions & 51 deletions src/modules/Lan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
# Input and output routines.
require "yast"
require "network/confirm_virt_proposal"
require "network/firewalld_interface_zones"
require "y2firewall/firewalld"

module Yast
class LanClass < Module
Expand All @@ -55,7 +53,6 @@ def main
Yast.import "Routing"
Yast.import "Progress"
Yast.import "String"
Yast.import "SuSEFirewall4Network"
Yast.import "FileUtils"
Yast.import "PackageSystem"
Yast.import "LanItems"
Expand Down Expand Up @@ -105,7 +102,6 @@ def Modified
return true if Routing.Modified
return true if NetworkConfig.Modified
return true if NetworkService.Modified
return true if SuSEFirewall.GetModified
return true if Host.GetModified

false
Expand Down Expand Up @@ -266,23 +262,21 @@ def Read(cache)
" ",
steps,
[
# Progress stage 1/9
# Progress stage 1/8
_("Detect network devices"),
# Progress stage 2/9
# Progress stage 2/8
_("Read driver information"),
# Progress stage 3/9 - multiple devices may be present, really plural
# Progress stage 3/8 - multiple devices may be present, really plural
_("Read device configuration"),
# Progress stage 4/9
# Progress stage 4/8
_("Read network configuration"),
# Progress stage 5/9
_("Read firewall settings"),
# Progress stage 6/9
# Progress stage 5/8
_("Read hostname and DNS configuration"),
# Progress stage 7/9
# Progress stage 6/8
_("Read installation information"),
# Progress stage 8/9
# Progress stage 8/8
_("Read routing configuration"),
# Progress stage 9/9
# Progress stage 9/8
_("Detect current status")
],
[],
Expand All @@ -296,7 +290,7 @@ def Read(cache)
# if(!Confirm::MustBeRoot()) return false;

return false if Abort()
# Progress step 1/9
# Progress step 1/8
ProgressNextStage(_("Detecting ndiswrapper...")) if @gui
# modprobe ndiswrapper before hwinfo when needed (#343893)
if !Mode.autoinst && PackageSystem.Installed("ndiswrapper")
Expand Down Expand Up @@ -337,22 +331,22 @@ def Read(cache)
Builtins.sleep(sl)

return false if Abort()
# Progress step 2/9
# Progress step 2/8
ProgressNextStage(_("Detecting network devices...")) if @gui
# Dont read hardware data in config mode
NetHwDetection.Start if !Mode.config

Builtins.sleep(sl)

return false if Abort()
# Progress step 3/9 - multiple devices may be present, really plural
# Progress step 3/8 - multiple devices may be present, really plural
ProgressNextStage(_("Reading device configuration...")) if @gui
LanItems.Read

Builtins.sleep(sl)

return false if Abort()
# Progress step 4/9
# Progress step 4/8
ProgressNextStage(_("Reading network configuration...")) if @gui
NetworkConfig.Read

Expand All @@ -361,34 +355,26 @@ def Read(cache)
Builtins.sleep(sl)

return false if Abort()
# Progress step 5/9
ProgressNextStage(_("Reading firewall settings...")) if @gui
orig = Progress.set(false)
FirewalldInterfaceZones.instance.read
Progress.set(orig) if @gui
Builtins.sleep(sl)

return false if Abort()
# Progress step 6/9
# Progress step 5/8
ProgressNextStage(_("Reading hostname and DNS configuration...")) if @gui
DNS.Read
Host.Read
Builtins.sleep(sl)

return false if Abort()
# Progress step 7/9
# Progress step 6/8
ProgressNextStage(_("Reading installation information...")) if @gui
# ReadInstallInf();
Builtins.sleep(sl)

return false if Abort()
# Progress step 8/9
# Progress step 7/8
ProgressNextStage(_("Reading routing configuration...")) if @gui
Routing.Read
Builtins.sleep(sl)

return false if Abort()
# Progress step 9/9
# Progress step 8/8
ProgressNextStage(_("Detecting current status...")) if @gui
NetworkService.Read
Builtins.sleep(sl)
Expand Down Expand Up @@ -487,8 +473,6 @@ def Write(gui: true)
return true
end

fw_is_installed = firewalld.installed?

# Write dialog caption
caption = _("Saving Network Configuration")

Expand All @@ -509,10 +493,6 @@ def Write(gui: true)
# Progress stage 7
_("Set up network services")
]
# Progress stage 8
if fw_is_installed
step_labels = Builtins.add(step_labels, _("Write firewall settings"))
end

# Progress stage 9
if !@write_only
Expand Down Expand Up @@ -574,17 +554,6 @@ def Write(gui: true)
writeIPv6
Builtins.sleep(sl)

# Show this only if SuSEfirewall is installed
if fw_is_installed
return false if Abort()
# Progress step 8
ProgressNextStage(_("Writing firewall settings..."))
orig = Progress.set(false)
FirewalldInterfaceZones.instance.apply_changes
Progress.set(orig)
Builtins.sleep(sl)
end

if !@write_only
return false if Abort()
# Progress step 9
Expand Down Expand Up @@ -1102,10 +1071,6 @@ def HaveXenBridge

private

def firewalld
Y2Firewall::Firewalld.instance
end

def activate_network_service
# If the second installation stage has been called by yast.ssh via
# ssh, we should not restart network because systemctl
Expand Down

0 comments on commit 09d668c

Please sign in to comment.