Hello community,

here is the log from the commit of package yast2-network for openSUSE:Factory 
checked in at 2018-03-04 11:50:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-network.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-network"

Sun Mar  4 11:50:58 2018 rev:380 rq:582001 version:4.0.19

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes      
2018-02-24 16:36:20.228019283 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 
2018-03-04 11:51:02.773507758 +0100
@@ -1,0 +2,21 @@
+Thu Mar  1 13:58:27 UTC 2018 - [email protected]
+
+- save_network client copies wicked dhcp files from inst-sys into
+  the target using the same dhcp id when rebooting after
+  installation. (bsc#1082832)
+- 4.0.19
+
+-------------------------------------------------------------------
+Thu Mar  1 13:56:21 UTC 2018 - [email protected]
+
+- Fixed a random build failure (introduced by the previous fix for
+  bsc#1083015)
+- 4.0.18
+
+-------------------------------------------------------------------
+Tue Feb 27 14:38:55 UTC 2018 - [email protected]
+
+- add missing textdomains (bsc#1083015)
+- 4.0.17
+
+-------------------------------------------------------------------

Old:
----
  yast2-network-4.0.16.tar.bz2

New:
----
  yast2-network-4.0.19.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.T1DRGQ/_old  2018-03-04 11:51:03.357486603 +0100
+++ /var/tmp/diff_new_pack.T1DRGQ/_new  2018-03-04 11:51:03.361486458 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.0.16
+Version:        4.0.19
 Release:        0
 BuildArch:      noarch
 

++++++ yast2-network-4.0.16.tar.bz2 -> yast2-network-4.0.19.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.0.16/package/yast2-network.changes 
new/yast2-network-4.0.19/package/yast2-network.changes
--- old/yast2-network-4.0.16/package/yast2-network.changes      2018-02-23 
12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/package/yast2-network.changes      2018-03-02 
15:21:01.000000000 +0100
@@ -1,4 +1,25 @@
 -------------------------------------------------------------------
+Thu Mar  1 13:58:27 UTC 2018 - [email protected]
+
+- save_network client copies wicked dhcp files from inst-sys into
+  the target using the same dhcp id when rebooting after
+  installation. (bsc#1082832)
+- 4.0.19
+
+-------------------------------------------------------------------
+Thu Mar  1 13:56:21 UTC 2018 - [email protected]
+
+- Fixed a random build failure (introduced by the previous fix for
+  bsc#1083015)
+- 4.0.18
+
+-------------------------------------------------------------------
+Tue Feb 27 14:38:55 UTC 2018 - [email protected]
+
+- add missing textdomains (bsc#1083015)
+- 4.0.17
+
+-------------------------------------------------------------------
 Fri Feb 23 11:27:58 UTC 2018 - [email protected]
 
 - Really translate firewalld zones (bsc#1082246)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.0.16/package/yast2-network.spec 
new/yast2-network-4.0.19/package/yast2-network.spec
--- old/yast2-network-4.0.16/package/yast2-network.spec 2018-02-23 
12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/package/yast2-network.spec 2018-03-02 
15:21:01.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.0.16
+Version:        4.0.19
 Release:        0
 BuildArch:      noarch
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.0.16/src/lib/network/clients/save_network.rb 
new/yast2-network-4.0.19/src/lib/network/clients/save_network.rb
--- old/yast2-network-4.0.16/src/lib/network/clients/save_network.rb    
2018-02-23 12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/src/lib/network/clients/save_network.rb    
2018-03-02 15:21:01.000000000 +0100
@@ -31,6 +31,8 @@
       nil
     end
 
+  private
+
     def adjust_for_network_disks(file)
       # storage-ng
       # Check if installation is targeted to a remote destination.
@@ -191,25 +193,7 @@
       # but definitely not looking well ;-)
       NetworkAutoYast.instance.create_udevs if Mode.autoinst
 
-      # Copy DHCP client cache so that we can request the same IP (#43974).
-      WFM.Execute(
-        path(".local.bash"),
-        Builtins.sformat(
-          "mkdir -p '%2%1'; /bin/cp -p %1/dhcpcd-*.cache '%2%1'",
-          "/var/lib/dhcpcd",
-          String.Quote(Installation.destdir)
-        )
-      )
-      # Copy DHCPv6 (DHCP for IPv6) client cache.
-      WFM.Execute(
-        path(".local.bash"),
-        Builtins.sformat(
-          "/bin/cp -p %1/ '%2%1'",
-          "/var/lib/dhcpv6",
-          String.Quote(Installation.destdir)
-        )
-      )
-
+      copy_dhcp_info
       copy_udev_rules
       CopyConfiguredNetworkFiles()
 
@@ -220,6 +204,44 @@
       nil
     end
 
+    # For copying wicked dhcp files (bsc#1082832)
+    WICKED_DHCP_PATH = "/var/lib/wicked/".freeze
+    WICKED_DHCP_FILES = ["duid.xml", "iaid.xml", "lease*.xml"].freeze
+    # For copying dhcp-client leases
+    # FIXME: We probably could omit the copy of these leases as we are using
+    # wicked during the installation instead of dhclient.
+    DHCPv4_PATH = "/var/lib/dhcp/".freeze
+    DHCPv6_PATH = "/var/lib/dhcp6/".freeze
+    DHCP_FILES = ["*.leases"].freeze
+
+    # Convenience method for copying dhcp files
+    def copy_dhcp_info
+      entries_to_copy = [
+        { dir: WICKED_DHCP_PATH, files: WICKED_DHCP_FILES },
+        { dir: DHCPv4_PATH, files: DHCP_FILES },
+        { dir: DHCPv6_PATH, files: DHCP_FILES }
+      ]
+
+      entries_to_copy.each { |e| copy_files_to_target(e[:files], e[:dir]) }
+    end
+
+    # Convenvenience method for copying a list of files into the target system.
+    # It takes care of creating the target directory but only if some file
+    # needs to be copied
+    #
+    # @param files [Array<String>] list of short filenames to be copied
+    # @param path [String] path where the files resides and where will be
+    # copied in the target system
+    # @return [Boolean] whether some file was copied
+    def copy_files_to_target(files, path)
+      dest_dir = ::File.join(Installation.destdir, path)
+      glob_files = ::Dir.glob(files.map { |f| File.join(path, f) })
+      return false if glob_files.empty?
+      ::FileUtils.mkdir_p(dest_dir)
+      ::FileUtils.cp(glob_files, dest_dir, preserve: true)
+      true
+    end
+
     # Creates target's default DNS configuration
     #
     # It proposes a predefined default values in common installation, exits
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.0.16/src/lib/network/lan_items_summary.rb 
new/yast2-network-4.0.19/src/lib/network/lan_items_summary.rb
--- old/yast2-network-4.0.16/src/lib/network/lan_items_summary.rb       
2018-02-23 12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/src/lib/network/lan_items_summary.rb       
2018-03-02 15:21:01.000000000 +0100
@@ -28,6 +28,7 @@
     include I18n
 
     def initialize
+      textdomain "network"
       Yast.import "LanItems"
       Yast.import "Summary"
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.0.16/src/lib/y2remote/dialogs/remote.rb 
new/yast2-network-4.0.19/src/lib/y2remote/dialogs/remote.rb
--- old/yast2-network-4.0.16/src/lib/y2remote/dialogs/remote.rb 2018-02-23 
12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/src/lib/y2remote/dialogs/remote.rb 2018-03-02 
15:21:01.000000000 +0100
@@ -26,6 +26,11 @@
 module Y2Remote
   module Dialogs
     class Remote < CWM::Dialog
+      def initialize
+        super
+        textdomain "network"
+      end
+
       def title
         _("Remote Administration")
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.0.16/src/lib/y2remote/display_manager.rb 
new/yast2-network-4.0.19/src/lib/y2remote/display_manager.rb
--- old/yast2-network-4.0.16/src/lib/y2remote/display_manager.rb        
2018-02-23 12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/src/lib/y2remote/display_manager.rb        
2018-03-02 15:21:01.000000000 +0100
@@ -35,6 +35,7 @@
     # Constructor
     def initialize
       Yast.import "Service"
+      textdomain "network"
     end
 
     # Whether the display manager service is enabled or not
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.0.16/src/lib/y2remote/modes/manager.rb 
new/yast2-network-4.0.19/src/lib/y2remote/modes/manager.rb
--- old/yast2-network-4.0.16/src/lib/y2remote/modes/manager.rb  2018-02-23 
12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/src/lib/y2remote/modes/manager.rb  2018-03-02 
15:21:01.000000000 +0100
@@ -105,6 +105,7 @@
       def enable!
         return false unless installed?
 
+        textdomain "network"
         if !Yast::Service.Enable(SERVICE)
           Yast::Report.Error(
             _("Enabling service %{service} has failed") % { service: SERVICE }
@@ -123,6 +124,7 @@
       def disable!
         return false unless installed?
 
+        textdomain "network"
         if !Yast::Service.Disable(SERVICE)
           Yast::Report.Error(
             _("Disabling service %{service} has failed") % { service: SERVICE }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.0.16/src/lib/y2remote/modes/socket_based.rb 
new/yast2-network-4.0.19/src/lib/y2remote/modes/socket_based.rb
--- old/yast2-network-4.0.16/src/lib/y2remote/modes/socket_based.rb     
2018-02-23 12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/src/lib/y2remote/modes/socket_based.rb     
2018-03-02 15:21:01.000000000 +0100
@@ -6,6 +6,9 @@
     module SocketBased
       def self.included(_base)
         Yast.import "SystemdSocket"
+        extend Yast::I18n
+
+        textdomain "network"
       end
 
       # Name of the socket to be managed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.0.16/test/save_network_test.rb 
new/yast2-network-4.0.19/test/save_network_test.rb
--- old/yast2-network-4.0.16/test/save_network_test.rb  2018-02-23 
12:45:48.000000000 +0100
+++ new/yast2-network-4.0.19/test/save_network_test.rb  2018-03-02 
15:21:01.000000000 +0100
@@ -33,7 +33,7 @@
 
       it "tunes ifcfg file for remote filesystem" do
         expect(Yast::SCR).to receive(:Execute).with(anything, /nfsroot/).once
-        subject.adjust_for_network_disks(file)
+        subject.send(:adjust_for_network_disks, file)
         expect(::File.read(file)).to include("STARTMODE=nfsroot")
       end
     end
@@ -43,9 +43,57 @@
 
       it "does not touch any configuration file" do
         expect(Yast::SCR).to_not receive(:Execute).with(anything, /nfsroot/)
-        subject.adjust_for_network_disks(file)
+        subject.send(:adjust_for_network_disks, file)
         expect(::File.read(file)).to eq(::File.read(template_file))
       end
     end
   end
+
+  describe "#copy_dhcp_info" do
+    let(:wicked_path) { described_class::WICKED_DHCP_PATH }
+    let(:dhcpv4_path) { described_class::DHCPv4_PATH }
+    let(:dhcpv6_path) { described_class::DHCPv6_PATH }
+    let(:wicked_files) do
+      described_class::WICKED_DHCP_FILES.map { |f| File.join(wicked_path, f) }
+    end
+    let(:dhcpv4_files) { described_class::DHCP_FILES.map { |f| 
File.join(dhcpv4_path, f) } }
+    let(:dhcpv6_files) { described_class::DHCP_FILES.map { |f| 
File.join(dhcpv6_path, f) } }
+    before do
+      allow(Yast::Installation).to receive(:destdir).and_return("/mnt")
+      allow(::FileUtils).to receive(:mkdir_p)
+      allow(::FileUtils).to receive(:cp)
+      allow(::Dir).to receive(:glob).with(wicked_files).and_return(["1.xml", 
"2.xml"])
+      allow(::Dir).to 
receive(:glob).with(dhcpv4_files).and_return(["3.leases"])
+      allow(::Dir).to 
receive(:glob).with(dhcpv6_files).and_return(["4.leases"])
+    end
+
+    it "creates the wicked directory if not exist" do
+      expect(::FileUtils).to receive(:mkdir_p).with("/mnt/var/lib/wicked/")
+
+      subject.send(:copy_dhcp_info)
+    end
+
+    it "copies the wicked dhcp files" do
+      expect(::FileUtils).to receive(:cp)
+        .with(["1.xml", "2.xml"], "/mnt/var/lib/wicked/", preserve: true)
+
+      subject.send(:copy_dhcp_info)
+    end
+
+    it "creates the dhcp client dirs if not exist" do
+      expect(::FileUtils).to receive(:mkdir_p).with("/mnt/var/lib/dhcp/")
+      expect(::FileUtils).to receive(:mkdir_p).with("/mnt/var/lib/dhcp6/")
+
+      subject.send(:copy_dhcp_info)
+    end
+
+    it "copies the dhcp client files" do
+      expect(::FileUtils).to receive(:cp)
+        .with(["3.leases"], "/mnt/var/lib/dhcp/", preserve: true)
+      expect(::FileUtils).to receive(:cp)
+        .with(["4.leases"], "/mnt/var/lib/dhcp6/", preserve: true)
+
+      subject.send(:copy_dhcp_info)
+    end
+  end
 end


Reply via email to