Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-samba-client for 
openSUSE:Factory checked in at 2021-04-10 15:25:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-samba-client (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-samba-client.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-samba-client"

Sat Apr 10 15:25:57 2021 rev:106 rq:882603 version:4.3.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-samba-client/yast2-samba-client.changes    
2020-08-14 13:09:26.797212884 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-samba-client.new.2401/yast2-samba-client.changes
  2021-04-10 15:26:08.318291029 +0200
@@ -0,0 +1,5 @@
+Mon Mar 15 12:24:52 UTC 2021 - Petr Pavlu <petr.pa...@suse.com>
+
+- Fix joining a domain when running a clustered Samba environment
+  (bsc#1181595).
+- 4.3.3

Old:
----
  yast2-samba-client-4.3.2.tar.bz2

New:
----
  yast2-samba-client-4.3.3.tar.bz2

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

Other differences:
------------------
++++++ yast2-samba-client.spec ++++++
--- /var/tmp/diff_new_pack.q2B0cF/_old  2021-04-10 15:26:08.842291645 +0200
+++ /var/tmp/diff_new_pack.q2B0cF/_new  2021-04-10 15:26:08.842291645 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-samba-client
 #
-# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,17 +12,17 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           yast2-samba-client
-Version:        4.3.2
+Version:        4.3.3
 Release:        0
 Summary:        YaST2 - Samba Client Configuration
 License:        GPL-2.0-only
 Group:          System/YaST
-Url:            https://github.com/yast/yast-samba-client
+URL:            https://github.com/yast/yast-samba-client
 
 Source0:        %{name}-%{version}.tar.bz2
 
@@ -36,7 +36,7 @@
 Requires:       yast2-pam >= 2.14.0
 # SuSEFirewall2 replaced by firewalld (fate#323460)
 Requires:       yast2 >= 4.0.39
-# LanItems::find_dhcp_ifaces
+# Yast::Lan.yast_config
 Requires:       yast2-network >= 4.2.0
 Requires:       yast2-python3-bindings >= 4.0.8
 Requires:       yast2-ruby-bindings >= 1.0.0

++++++ yast2-samba-client-4.3.2.tar.bz2 -> yast2-samba-client-4.3.3.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/.github/workflows/ci.yml 
new/yast2-samba-client-4.3.3/.github/workflows/ci.yml
--- old/yast2-samba-client-4.3.2/.github/workflows/ci.yml       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-samba-client-4.3.3/.github/workflows/ci.yml       2021-04-01 
16:46:56.000000000 +0200
@@ -0,0 +1,36 @@
+
+# See 
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
+
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+  Package:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    - name: Package Build
+      run: yast-ci-ruby -o package
+
+  # downloading the Docker image takes some time so bundling several fast
+  # checks into one job avoids that overhead
+  Checks:
+    runs-on: ubuntu-latest
+    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+
+    steps:
+
+    - name: Git Checkout
+      uses: actions/checkout@v2
+
+    - name: Perl Syntax
+      run: yast-ci-ruby -o perl_syntax
+
+    - name: POT Check
+      run: rake check:pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/.travis.yml 
new/yast2-samba-client-4.3.3/.travis.yml
--- old/yast2-samba-client-4.3.2/.travis.yml    2020-08-12 12:09:57.000000000 
+0200
+++ new/yast2-samba-client-4.3.3/.travis.yml    1970-01-01 01:00:00.000000000 
+0100
@@ -1,11 +0,0 @@
-sudo: required
-language: bash
-services:
-  - docker
-
-before_install:
-  - docker build -t yast-samba-client-image .
-script:
-  # the "yast-travis-ruby" script is included in the base yastdevel/ruby image
-  # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
-  - docker run -it --privileged -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-samba-client-image yast-travis-ruby
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/Dockerfile 
new/yast2-samba-client-4.3.3/Dockerfile
--- old/yast2-samba-client-4.3.2/Dockerfile     2020-08-12 12:09:57.000000000 
+0200
+++ new/yast2-samba-client-4.3.3/Dockerfile     1970-01-01 01:00:00.000000000 
+0100
@@ -1,3 +0,0 @@
-FROM registry.opensuse.org/yast/head/containers/yast-ruby:latest
-COPY . /usr/src/app
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/README.md 
new/yast2-samba-client-4.3.3/README.md
--- old/yast2-samba-client-4.3.2/README.md      2020-08-12 12:09:57.000000000 
+0200
+++ new/yast2-samba-client-4.3.3/README.md      2021-04-01 16:46:56.000000000 
+0200
@@ -1,5 +1,6 @@
 # YaST - The Samba Client Module #
 
-[![Travis 
Build](https://travis-ci.org/yast/yast-samba-client.svg?branch=master)](https://travis-ci.org/yast/yast-samba-client)
-[![Jenkins 
Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-samba-client-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-samba-client-master/)
-
+[![Workflow 
Status](https://github.com/yast/yast-samba-client/workflows/CI/badge.svg?branch=master)](
+https://github.com/yast/yast-samba-client/actions?query=branch%3Amaster)
+[![Jenkins 
Status](https://ci.opensuse.org/buildStatus/icon?job=yast-yast-samba-client-master)](
+https://ci.opensuse.org/view/Yast/job/yast-yast-samba-client-master/)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-4.3.2/package/yast2-samba-client.changes 
new/yast2-samba-client-4.3.3/package/yast2-samba-client.changes
--- old/yast2-samba-client-4.3.2/package/yast2-samba-client.changes     
2020-08-12 12:09:57.000000000 +0200
+++ new/yast2-samba-client-4.3.3/package/yast2-samba-client.changes     
2021-04-01 16:46:56.000000000 +0200
@@ -1,3 +1,8 @@
+Mon Mar 15 12:24:52 UTC 2021 - Petr Pavlu <petr.pa...@suse.com>
+
+- Fix joining a domain when running a clustered Samba environment
+  (bsc#1181595).
+- 4.3.3
 -------------------------------------------------------------------
 Mon Aug 10 17:52:46 CEST 2020 - sch...@suse.de
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-4.3.2/package/yast2-samba-client.spec 
new/yast2-samba-client-4.3.3/package/yast2-samba-client.spec
--- old/yast2-samba-client-4.3.2/package/yast2-samba-client.spec        
2020-08-12 12:09:57.000000000 +0200
+++ new/yast2-samba-client-4.3.3/package/yast2-samba-client.spec        
2021-04-01 16:46:56.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-samba-client
-Version:        4.3.2
+Version:        4.3.3
 Release:        0
 Summary:        YaST2 - Samba Client Configuration
 Group:          System/YaST
@@ -36,7 +36,7 @@
 Requires:       yast2-pam >= 2.14.0
 # SuSEFirewall2 replaced by firewalld (fate#323460)
 Requires:       yast2 >= 4.0.39
-# LanItems::find_dhcp_ifaces
+# Yast::Lan.yast_config
 Requires:       yast2-network >= 4.2.0
 Requires:       yast2-ruby-bindings >= 1.0.0
 Requires:       yast2-python3-bindings >= 4.0.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/src/Makefile.am 
new/yast2-samba-client-4.3.3/src/Makefile.am
--- old/yast2-samba-client-4.3.2/src/Makefile.am        2020-08-12 
12:09:57.000000000 +0200
+++ new/yast2-samba-client-4.3.3/src/Makefile.am        2021-04-01 
16:46:56.000000000 +0200
@@ -8,6 +8,7 @@
   modules/SambaAD.pm \
   modules/SambaAPI.py \
   modules/SambaNetJoin.pm \
+  modules/SambaNetUtils.rb \
   modules/SambaWinbind.pm
 
 client_DATA = \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-4.3.2/src/include/samba-client/dialogs.rb 
new/yast2-samba-client-4.3.3/src/include/samba-client/dialogs.rb
--- old/yast2-samba-client-4.3.2/src/include/samba-client/dialogs.rb    
2020-08-12 12:09:57.000000000 +0200
+++ new/yast2-samba-client-4.3.3/src/include/samba-client/dialogs.rb    
2021-04-01 16:46:56.000000000 +0200
@@ -42,6 +42,7 @@
       Yast.import "Popup"
       Yast.import "Samba"
       Yast.import "SambaConfig"
+      Yast.import "SambaNetUtils"
       Yast.import "Stage"
       Yast.import "Wizard"
 
@@ -637,7 +638,7 @@
                   )
                 ),
                 Left(
-                  SambaAD.ADS != "" && !SambaAD.IsDHCPClient(false) ?
+                  SambaAD.ADS != "" && !SambaNetUtils.IsDHCPClient() ?
                     # checkbox label
                     CheckBox(Id(:adapt_dns), _("Change primary DNS suffix")) :
                     VBox()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/src/modules/SambaAD.pm 
new/yast2-samba-client-4.3.3/src/modules/SambaAD.pm
--- old/yast2-samba-client-4.3.2/src/modules/SambaAD.pm 2020-08-12 
12:09:57.000000000 +0200
+++ new/yast2-samba-client-4.3.3/src/modules/SambaAD.pm 2021-04-01 
16:46:56.000000000 +0200
@@ -39,7 +39,6 @@
 
 YaST::YCP::Import ("FileUtils");
 YaST::YCP::Import ("Kerberos");
-YaST::YCP::Import ("LanItems");
 YaST::YCP::Import ("Mode");
 YaST::YCP::Import ("SCR");
 YaST::YCP::Import ("SambaConfig");
@@ -60,22 +59,6 @@
 # Kerberos realm for AD
 my $realm      = "";
 
-# remember if machine is DHCP client
-my $dhcp_client         = undef;
-
-# Checks if machine is DHCP client
-# @param force  do force check (otherwise use latest state)
-BEGIN{$TYPEINFO{IsDHCPClient}=["function","boolean", "boolean"]}
-sub IsDHCPClient {
-
-    my ($self, $force) = @_;
-
-    return $dhcp_client if (defined $dhcp_client) && !$force;
-    LanItems->Read();
-    my @dhcp_interfaces = LanItems->find_dhcp_ifaces();
-    return scalar (@dhcp_interfaces) > 0;
-}
-
 # Read the list of available machine accounts in the current domain
 #
 # @param domain                AD domain
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-4.3.2/src/modules/SambaNetJoin.pm 
new/yast2-samba-client-4.3.3/src/modules/SambaNetJoin.pm
--- old/yast2-samba-client-4.3.2/src/modules/SambaNetJoin.pm    2020-08-12 
12:09:57.000000000 +0200
+++ new/yast2-samba-client-4.3.3/src/modules/SambaNetJoin.pm    2021-04-01 
16:46:56.000000000 +0200
@@ -23,6 +23,7 @@
 YaST::YCP::Import("SCR");
 YaST::YCP::Import("SambaConfig");
 YaST::YCP::Import("SambaAD");
+YaST::YCP::Import("SambaNetUtils");
 YaST::YCP::Import("SambaWinbind");
 YaST::YCP::Import("String");
 
@@ -82,23 +83,9 @@
       return FALSE;
     }
 
-    if (SambaAD->IsDHCPClient (FALSE)) {
-      y2milestone ("DHCP client found: checking if IP addresses are configured 
for CTDB traffic...");
-      # Go through IP addresses and check if they are cofigured for CTDB 
(/etc/ctdb/nodes).
-      # This is not a perfect solution, but as we cannot find out if IP is 
statically assigned by
-      # DHCP server, we have at least a hint that current addresses seem to be 
configured correctly.
-      # See bnc#811008
-      my $nodes = SCR->Read (".target.string", "/etc/ctdb/nodes") || "";
-      my $out   = SCR->Execute (".target.bash_output",
-        "LANG=C /sbin/ifconfig | grep 'inet addr' | grep -v '127.0.0.1' | cut 
-d: -f2 | cut -d ' ' -f1");
-      my $cluster_ip    = TRUE;
-      foreach my $line (split (/\n/,$out->{"stdout"} || "")) {
-        if ($nodes !~ /$line/) {
-          y2warning ("IP address $line is not configured for CTDB");
-          $cluster_ip   = FALSE;
-        }
-      }
-      return FALSE unless $cluster_ip;
+    # are IP addresses configured for CTDB?
+    unless (SambaNetUtils->IsIPValidForCTDB ()) {
+      return FALSE;
     }
 
     my $out     = SCR->Execute (".target.bash_output", "/usr/sbin/crm_mon -s");
@@ -182,15 +169,9 @@
     # 8. Wait until the unhealthy status disappears.
     my $start   = time;
     my $wait    = 60; # 1 minute timeout
-    my $ctdbd_socket = SambaConfig->GlobalGetStr("ctdbd socket", undef);
-    my $ctdb_args = "";
-    if (defined $ctdbd_socket) {
-      $ctdb_args = "--socket=$ctdbd_socket";
-    }
 
     while (time<$start+$wait) {
-      my $out = SCR->Execute(".target.bash_output",
-                            "/usr/bin/ctdb $ctdb_args status");
+      my $out = SCR->Execute(".target.bash_output", "/usr/bin/ctdb status");
       last if ($out->{"exit"} == 0);
       sleep (1); #0.5);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-4.3.2/src/modules/SambaNetUtils.rb 
new/yast2-samba-client-4.3.3/src/modules/SambaNetUtils.rb
--- old/yast2-samba-client-4.3.2/src/modules/SambaNetUtils.rb   1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-samba-client-4.3.3/src/modules/SambaNetUtils.rb   2021-04-01 
16:46:56.000000000 +0200
@@ -0,0 +1,92 @@
+# Copyright (c) [2021] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
+require "yast"
+
+module Yast
+  class SambaNetUtilsClass < Module
+    def main
+      textdomain "samba-client"
+
+      Yast.import "Lan"
+      Yast.import "String"
+    end
+
+    # Checks if any interface is configured to use DHCP.
+    #
+    # @return [Boolean] true when an interface uses DHCP config
+    def IsDHCPClient
+      Yast::Lan.ReadWithCacheNoGUI
+      config = Yast::Lan.yast_config
+      return false unless config&.connections
+      config.connections.any?(&:dhcp?)
+    end
+
+    # Checks if all IP addresses are configured for CTDB (/etc/ctdb/nodes).
+    #
+    # Note: This is not a perfect solution, but as we cannot find out if IP is 
statically assigned
+    # by DHCP server, we have at least a hint that current addresses seem to 
be configured
+    # correctly. See bnc#811008.
+    #
+    # @return [Boolean] true when all IP addresses are configured for CTDB
+    def IsIPValidForCTDB
+      return true unless IsDHCPClient()
+      Builtins.y2milestone(
+        "DHCP client found: checking if IP addresses are configured for CTDB 
traffic..."
+      )
+
+      Yast::Lan.ReadWithCacheNoGUI
+      config = Yast::Lan.yast_config
+      return true unless config&.connections
+
+      # Collect the first IP address of each interface that is configured by 
DHCP.
+      iface_names = config.connections.select(&:dhcp?).map(&:interface)
+      used_ips = iface_names.each_with_object([]) do |iface, res|
+        cmd = "LANG=C /usr/sbin/ip addr show dev #{iface.shellescape} scope 
global | " \
+          "grep --max-count=1 'inet\\(6\\)\\?' | " \
+          "sed 's/^[ \\t]\\+inet\\(6\\)\\?[ \\t]\\+\\([^\\/]\\+\\)\\/.*$/\\2/'"
+        out = Convert.to_map(SCR.Execute(path(".target.bash_output"), cmd))
+        if Ops.get_integer(out, "exit", 0) != 0
+          Builtins.y2error("Cannot get IP information for '%1': %2", iface, 
out)
+          next
+        end
+        res.concat(String.NewlineItems(Ops.get_string(out, "stdout", "")))
+      end
+
+      # Obtain CTDB private addresses from /etc/ctdb/nodes.
+      out = SCR.Read(path(".target.string"), "/etc/ctdb/nodes") || ""
+      nodes = String.NewlineItems(out)
+
+      cluster_ip = true
+      used_ips.each do |address|
+        if !nodes.include? address
+          Builtins.y2warning("IP address #{address} is not configured for 
CTDB")
+          cluster_ip = false
+        end
+      end
+      cluster_ip
+    end
+
+    publish :function => :IsDHCPClient, :type => "boolean ()"
+    publish :function => :IsIPValidForCTDB, :type => "boolean ()"
+  end
+
+  SambaNetUtils = SambaNetUtilsClass.new
+  SambaNetUtils.main
+end

Reply via email to