Hello community,

here is the log from the commit of package yast2-drbd for openSUSE:Factory 
checked in at 2015-05-15 10:06:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-drbd (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-drbd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-drbd"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-drbd/yast2-drbd.changes    2014-12-22 
12:53:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-drbd.new/yast2-drbd.changes       
2015-05-15 10:06:12.000000000 +0200
@@ -1,0 +2,7 @@
+Fri May 15 06:44:30 UTC 2015 - [email protected]
+
+- Feature implementation for SLE12SP1
+- Fate#317957, Fate#318555, Fate#318391
+- Version 3.1.12
+
+-------------------------------------------------------------------

Old:
----
  yast2-drbd-3.1.11.tar.bz2

New:
----
  drbd-cluster.fwd
  yast2-drbd-3.1.12.tar.bz2

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

Other differences:
------------------
++++++ yast2-drbd.spec ++++++
--- /var/tmp/diff_new_pack.DZTtOB/_old  2015-05-15 10:06:12.000000000 +0200
+++ /var/tmp/diff_new_pack.DZTtOB/_new  2015-05-15 10:06:12.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-drbd
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,11 +17,13 @@
 
 
 Name:           yast2-drbd
-Version:        3.1.11
+Version:        3.1.12
 Release:        0
 
+%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
+Source1:        drbd-cluster.fwd
 
 BuildRequires:  perl-XML-Writer
 BuildRequires:  ruby
@@ -57,6 +59,9 @@
 %install
 %yast_install
 
+mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
+install -m 644 %{S:1} $RPM_BUILD_ROOT/%{_fwdefdir}/drbd
+
 %files
 %defattr(-,root,root)
 %{yast_yncludedir}/drbd/
@@ -68,5 +73,6 @@
 %{yast_agentdir}/ag_drbd
 %{yast_agentdir}/drbd.rb.yy
 %doc %{yast_docdir}
+%config %{_fwdefdir}/drbd
 
 %changelog

++++++ drbd-cluster.fwd ++++++
## Name: Drbd
## Description: Opens ports for DRBD.
##   Port 7788 and higher is recommend.

# space separated list of allowed TCP ports
TCP="7788"

# space separated list of allowed UDP ports
UDP=""

# space separated list of allowed RPC services
RPC=""

# space separated list of allowed IP protocols
IP=""

# space separated list of allowed UDP broadcast ports
BROADCAST=""
++++++ yast2-drbd-3.1.11.tar.bz2 -> yast2-drbd-3.1.12.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/CONTRIBUTING.md 
new/yast2-drbd-3.1.12/CONTRIBUTING.md
--- old/yast2-drbd-3.1.11/CONTRIBUTING.md       2014-12-22 04:16:16.000000000 
+0100
+++ new/yast2-drbd-3.1.12/CONTRIBUTING.md       2015-05-15 08:56:08.000000000 
+0200
@@ -12,13 +12,13 @@
 -----------
 
 If you find a problem, please report it either using
-[Bugzilla](https://bugzilla.novell.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2)
+[Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2)
 or [GitHub issues](../../issues). (For Bugzilla, use the [simplified
 
registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp)
 if you don't have an account yet.)
 
 If you find a problem, please report it either using
-[Bugzilla](https://bugzilla.novell.com/) or GitHub issues. We can't guarantee
+[Bugzilla](https://bugzilla.suse.com/) or GitHub issues. We can't guarantee
 that every bug will be fixed, but we'll try.
 
 When creating a bug report, please follow our [bug reporting
@@ -71,7 +71,7 @@
 [widely used
 
conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
 
-If your commit is related to a bug in Buzgilla or an issue on GitHub, make sure
+If your commit is related to a bug in Bugzilla or an issue on GitHub, make sure
 you mention it in the commit message for cross-reference. Use format like
 bnc#775814 or gh#yast/yast-foo#42. See also [GitHub
 
autolinking](https://help.github.com/articles/github-flavored-markdown#references)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/package/drbd-cluster.fwd 
new/yast2-drbd-3.1.12/package/drbd-cluster.fwd
--- old/yast2-drbd-3.1.11/package/drbd-cluster.fwd      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-drbd-3.1.12/package/drbd-cluster.fwd      2015-05-15 
08:56:09.000000000 +0200
@@ -0,0 +1,18 @@
+## Name: Drbd
+## Description: Opens ports for DRBD.
+##   Port 7788 and higher is recommend.
+
+# space separated list of allowed TCP ports
+TCP="7788"
+
+# space separated list of allowed UDP ports
+UDP=""
+
+# space separated list of allowed RPC services
+RPC=""
+
+# space separated list of allowed IP protocols
+IP=""
+
+# space separated list of allowed UDP broadcast ports
+BROADCAST=""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/package/yast2-drbd.changes 
new/yast2-drbd-3.1.12/package/yast2-drbd.changes
--- old/yast2-drbd-3.1.11/package/yast2-drbd.changes    2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/package/yast2-drbd.changes    2015-05-15 
08:56:09.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri May 15 06:44:30 UTC 2015 - [email protected]
+
+- Feature implementation for SLE12SP1
+- Fate#317957, Fate#318555, Fate#318391
+- Version 3.1.12
+
+-------------------------------------------------------------------
 Mon Dec 22 03:08:39 UTC 2014 - [email protected]
 
 - BNC#900818. Corresponding change of modification of drbd-utils.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/package/yast2-drbd.spec 
new/yast2-drbd-3.1.12/package/yast2-drbd.spec
--- old/yast2-drbd-3.1.11/package/yast2-drbd.spec       2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/package/yast2-drbd.spec       2015-05-15 
08:56:09.000000000 +0200
@@ -17,11 +17,13 @@
 
 
 Name:           yast2-drbd
-Version:        3.1.11
+Version:        3.1.12
 Release:        0
 
+%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
+Source1:        drbd-cluster.fwd
 
 BuildRequires:  perl-XML-Writer
 BuildRequires:  ruby
@@ -57,6 +59,9 @@
 %install
 %yast_install
 
+mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
+install -m 644 %{S:1} $RPM_BUILD_ROOT/%{_fwdefdir}/drbd
+
 %files
 %defattr(-,root,root)
 %{yast_yncludedir}/drbd/
@@ -68,5 +73,6 @@
 %{yast_agentdir}/ag_drbd
 %{yast_agentdir}/drbd.rb.yy
 %doc %{yast_docdir}
+%config %{_fwdefdir}/drbd
 
 %changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/Makefile.am 
new/yast2-drbd-3.1.12/src/Makefile.am
--- old/yast2-drbd-3.1.11/src/Makefile.am       2014-12-22 04:16:17.000000000 
+0100
+++ new/yast2-drbd-3.1.12/src/Makefile.am       2015-05-15 08:56:09.000000000 
+0200
@@ -19,10 +19,12 @@
   include/drbd/resource_conf.rb \
   include/drbd/helps.rb \
   include/drbd/global_conf.rb \
+  include/drbd/lvm_conf.rb \
   include/drbd/wizards.rb
 
 scrconf_DATA = \
-  scrconf/drbd.scr
+  scrconf/drbd.scr \
+  scrconf/drbd_lvm.scr
 
 desktop_DATA = \
   desktop/drbd.desktop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/include/drbd/common.rb 
new/yast2-drbd-3.1.12/src/include/drbd/common.rb
--- old/yast2-drbd-3.1.11/src/include/drbd/common.rb    2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/include/drbd/common.rb    2015-05-15 
08:56:09.000000000 +0200
@@ -36,7 +36,7 @@
       Yast.import "Popup"
       Yast.import "CWM"
 
-      @DIALOG = ["startup_conf", "global_conf", "resource_conf"]
+      @DIALOG = ["startup_conf", "global_conf", "resource_conf","lvm_conf"]
 
       @PARENT = {}
 
@@ -44,6 +44,7 @@
         "startup_conf"  => _("Start-up Configuration"),
         "global_conf"   => _("Global Configuration"),
         "resource_conf" => _("Resource Configuration"),
+        "lvm_conf"      => _("LVM Configuration"),
         "basic_conf"    => _("Resource Basic Configuration"),
         "advance_conf"  => _("Resource Advanced Configuration")
       }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/include/drbd/helps.rb 
new/yast2-drbd-3.1.12/src/include/drbd/helps.rb
--- old/yast2-drbd-3.1.11/src/include/drbd/helps.rb     2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/include/drbd/helps.rb     2015-05-15 
08:56:09.000000000 +0200
@@ -109,6 +109,24 @@
               "\t\t<p><b>al-extents</b>: parameter  you control how big the 
hot area (= active set) can get. The default number of extents is 127. 
(Minimum: 7, Maximum: 3843)</p>\n" +
               "\t\t"
           ),
+         "lvm_conf"  => _(
+          "<p><b><big>LVM Configuration</big></b></p>"
+        ) +
+          _(
+            "\n" +
+              "\t\t<p><b>LVM configuration file /etc/lvm/lvm.conf</b></p>\n" +
+              "\t\t<p>To use LVM with DRBD, it is necessary to change some 
options in the LVM configuration file and to remove stale cache entries on the 
nodes.</p>" +
+              "\t\t<p>Refer to 'man lvm.conf' for further information 
including the file layout.</p>\n" +
+              "\t\t\t\t\t\t\t\t\t\t  \n" +
+              "\t\t<p><b>Device Filter</b>: This masks the underlying block 
device from the list of devices LVM scans for Physical Volume signatures. This 
way, LVM is instructed to read Physical Volume signatures from DRBD devices, 
rather than from the underlying backing block devices.</p>" +
+              "\t\t<p><b>AutoFilter</b>: According to the configuration of 
drbd, LVM filter will always be changed automatically. To change it manually, 
disable the checkbox of AutoFilter.</p>\n" +
+              "\t\t<p>The filter consists of an array of regular expressions. 
These expressions can be delimited by a character of your choice, and prefixed 
with either an 'a' (for accept) or 'r' (for reject).</p>" +
+              "\t\t<p>For example, setting filter as 
[\"r|/dev/sda.*|\"]</p>\n" +
+              "\n" +
+              "\t\t<p><b>LVM cache</b>: Enable/turn on writing the LVM cache 
is default. Disable cache when for network storage, like nfs. </p>\n" +
+              "\n" +
+              "\t\t"
+          ),
         "global_conf"   => _(
           "<p><b><big>Global Configuration of DRBD</big></b></p>"
         ) +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/include/drbd/lvm_conf.rb 
new/yast2-drbd-3.1.12/src/include/drbd/lvm_conf.rb
--- old/yast2-drbd-3.1.11/src/include/drbd/lvm_conf.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/include/drbd/lvm_conf.rb  2015-05-15 
08:56:09.000000000 +0200
@@ -0,0 +1,175 @@
+# encoding: utf-8
+
+module Yast
+  module DrbdLvmConfInclude
+    def initialize_drbd_lvm_conf(include_target)
+      textdomain "drbd"
+
+      Yast.import "Label"
+      Yast.import "Wizard"
+      Yast.import "Drbd"
+
+      Yast.include include_target, "drbd/helps.rb"
+      Yast.include include_target, "drbd/common.rb"
+
+      @filter = ""
+      @cache = true
+      # Default is always true (auto)
+      @auto_lvm_filter = true
+    end
+
+    def lvm_conf_Read
+      @filter = Ops.get_string( Drbd.lvm_config, "filter", "" )
+      cache_str = Ops.get_string( Drbd.lvm_config, "write_cache_state", "1" )
+
+      if cache_str == "0"
+        @cache = false
+      else
+        @cache = true
+      end
+
+      nil
+    end
+
+    def lvm_conf_GetDialog
+      _Tfilter = Frame(
+        _("LVM Filter Configuration of DRBD"),
+        Left(
+          VBox(
+            VBox(
+              Left(
+                CheckBox(
+                  Id(:AutoFilter),
+                  Opt(:notify),
+                  _("Modify LVM Device filter Automatically"),
+                  @auto_lvm_filter
+                )
+              )
+            ),
+            VBox(
+              Left(
+                InputField(
+                  Id(:Filter),
+                  Opt(:hstretch),
+                  _("Device Filter"),
+                  @filter
+                )
+              )
+            ),
+          )
+        )
+      )
+
+      _Tcache = Frame(
+        _("Writing the LVM cache"),
+        Left(
+          HSquash(
+            VBox(
+              VBox(
+                Left(
+                  CheckBox(
+                    Id(:LVMCache),
+                    Opt(:notify),
+                    _("Enable LVM Cache"),
+                    @cache
+                  )
+                )
+              ),
+            )
+          )
+        )
+      )
+
+      VBox(
+        _Tfilter,
+        VSpacing(1),
+        _Tcache,
+        VStretch()
+      )
+    end
+
+    def lvm_conf_Write
+      @filter = UI.QueryWidget(Id(:Filter), :Value).to_s
+      @auto_lvm_filter = UI.QueryWidget(Id(:AutoFilter), :Value)
+
+      @cache = UI.QueryWidget(Id(:LVMCache), :Value)
+
+      if @cache
+        cache_str = "1"
+      else
+        cache_str = "0"
+      end
+
+      Drbd.auto_lvm_filter = @auto_lvm_filter
+      Ops.set(Drbd.lvm_config, "write_cache_state", cache_str)
+
+      if !@auto_lvm_filter
+        Ops.set(Drbd.lvm_config, "filter", @filter)
+        Builtins.y2debug("Change Device Filter manually.")
+      end
+
+      Drbd.modified = true
+
+      true
+    end
+
+    def status_switch
+      if UI.QueryWidget(Id(:AutoFilter), :Value)
+        UI.ChangeWidget(Id(:Filter), :Enabled, false)
+      else
+        UI.ChangeWidget(Id(:Filter), :Enabled, true)
+      end
+
+      nil
+    end
+
+    def ConfigureLVMDialog
+      lvm_conf_Read
+
+      my_SetContents("lvm_conf", lvm_conf_GetDialog)
+      status_switch
+
+      ret = nil
+      while true
+        Wizard.SelectTreeItem("lvm_conf")
+        status_switch
+
+        ret = UI.UserInput
+
+        if ret == :help
+          #myHelp("lvm_conf")
+          next
+        end
+
+        if ret == :wizardTree
+          ret = Convert.to_string(UI.QueryWidget(Id(:wizardTree), 
:CurrentItem))
+        end
+
+        if ret == :Filter || ret == :LVMCache || ret == :AutoFilter
+          Drbd.modified = true
+          next
+        end
+
+        if ret == :abort || ret == :cancel
+          if ReallyAbort()
+            return deep_copy(ret)
+          else
+            next
+          end
+        end
+
+        if ret == :next || ret == :back ||
+            Builtins.contains(@DIALOG, Builtins.tostring(ret))
+          next if !lvm_conf_Write
+
+          if ret != :next && ret != :back
+            ret = Builtins.symbolof(Builtins.toterm(ret))
+          end
+
+          break
+        end
+      end
+      deep_copy(ret)
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/include/drbd/resource_conf.rb 
new/yast2-drbd-3.1.12/src/include/drbd/resource_conf.rb
--- old/yast2-drbd-3.1.11/src/include/drbd/resource_conf.rb     2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/include/drbd/resource_conf.rb     2015-05-15 
08:56:09.000000000 +0200
@@ -242,6 +242,32 @@
       )
     end
 
+    def update_add_disk_list
+      # Update new add disk used of drbd res for LVM filter
+      # Ignore the removed disk
+      local_hname = Drbd.local_hostname
+
+      node1 = UI.QueryWidget(Id(:n1_name), :Value).to_s.strip()
+      node2 = UI.QueryWidget(Id(:n2_name), :Value).to_s.strip()
+
+      if local_hname == node1
+        disk = UI.QueryWidget(Id(:n1_disk), :Value).to_s.strip()
+      elsif local_hname == node2
+        disk = UI.QueryWidget(Id(:n2_disk), :Value).to_s.strip()
+      else
+        disk = nil
+        Builtins.y2error("Disk is not belong to local. localhost is %1,
+          node1 is %2, node2 is %3.", local_hname, node1, node2)
+      end
+      Builtins.y2debug("Add %1 to add disk list.", disk)
+
+      if disk && !Drbd.local_disks_ori.include?(disk) &&
+        !Drbd.local_disks_added.include?(disk)
+        Drbd.local_disks_added.push(disk)
+      end
+
+      nil
+    end
 
     def save_basic_config(res_config)
       res_config = deep_copy(res_config)
@@ -593,6 +619,9 @@
           res_config = save_basic_config(res_config)
           Builtins.y2debug("res_config = %1", res_config)
 
+          # For change LVM filter automatically
+          update_add_disk_list
+
           my_SetContents(
             "advance_conf",
             res_advance_config_get_dialog(res_config)
@@ -635,6 +664,9 @@
 
           Builtins.y2debug("res_config=%1", res_config)
 
+          # For change LVM filter automatically
+          update_add_disk_list
+
           if Ops.greater_than(Builtins.size(resname), 0)
             Drbd.resource_config = Builtins.remove(
               Drbd.resource_config,
@@ -701,6 +733,7 @@
         "list"     => {
           :startup_conf => :startup_conf,
           :global_conf  => :global_conf,
+          :lvm_conf     => :lvm_conf,
           :add          => "add",
           :edit         => "edit",
           :list         => "list",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/include/drbd/startup_conf.rb 
new/yast2-drbd-3.1.12/src/include/drbd/startup_conf.rb
--- old/yast2-drbd-3.1.11/src/include/drbd/startup_conf.rb      2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/include/drbd/startup_conf.rb      2015-05-15 
08:56:09.000000000 +0200
@@ -16,6 +16,7 @@
       Yast.import "Wizard"
       Yast.import "Service"
       Yast.import "Drbd"
+      Yast.import "CWMFirewallInterfaces"
 
       Yast.include include_target, "drbd/helps.rb"
       Yast.include include_target, "drbd/common.rb"
@@ -33,7 +34,7 @@
               Left(
                 RadioButton(
                   Id("on"),
-                  _("On -- Start DRBD Server Now and when Booting")
+                  _("On -- Start DRBD Server when Booting")
                 )
               ),
               Left(
@@ -70,6 +71,20 @@
         )
       )
 
+      # Just a dialog
+      firewall_widget = CWMFirewallInterfaces.CreateOpenFirewallWidget(
+        {
+          #servie:drbd is the  name of 
/etc/sysconfig/SuSEfirewall2.d/services/drbd
+          "services"        => [
+            "service:drbd"
+          ],
+          "display_details" => true
+        }
+      )
+      Builtins.y2milestone("%1", firewall_widget)
+      # firewall_layout is just a dialog
+      firewall_layout = Ops.get_term(firewall_widget, "custom_widget", VBox())
+
       _Tpropagate = Frame(
         _("Propagate Configuration"),
         Left(
@@ -98,6 +113,8 @@
         VSpacing(1),
         _Tonoff,
         VSpacing(1),
+        firewall_layout,
+        VSpacing(1),
         _Tpropagate,
         VStretch()
       )
@@ -107,6 +124,8 @@
       my_SetContents("startup_conf", contents)
 
       UI.ChangeWidget(Id("server_type"), :CurrentButton, boot ? "on" : "off")
+      CWMFirewallInterfaces.OpenFirewallInit(firewall_widget, "")
+      event = {}
 
       ret = nil
       while true
@@ -124,7 +143,9 @@
           )
         )
 
-        ret = UI.UserInput
+        # add event
+        event = UI.WaitForEvent
+        ret = Ops.get(event, "ID")
 
         if ret == :abort || ret == :cancel
           if ReallyAbort()
@@ -134,7 +155,10 @@
           end
         end
 
-        break if ret == :next || ret == :back
+        if ret == :next || ret == :back
+          CWMFirewallInterfaces.OpenFirewallStore(firewall_widget, "", event)
+          break
+        end
 
         if ret == "start_now"
           if !Service.Start("drbd")
@@ -152,10 +176,10 @@
           next
         end
 
-        if ret == :help
-          myHelp("startup_conf")
-          next
-        end
+        #if ret == :help
+        #  myHelp("startup_conf")
+        #  next
+        #end
 
         if ret == :wizardTree
           ret = Convert.to_string(UI.QueryWidget(Id(:wizardTree), 
:CurrentItem))
@@ -166,6 +190,8 @@
           break
         end
 
+        CWMFirewallInterfaces.OpenFirewallHandle(firewall_widget, "", event)
+
         Builtins.y2error("unexpected retcode: %1", ret)
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/include/drbd/wizards.rb 
new/yast2-drbd-3.1.12/src/include/drbd/wizards.rb
--- old/yast2-drbd-3.1.11/src/include/drbd/wizards.rb   2014-12-22 
04:16:17.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/include/drbd/wizards.rb   2015-05-15 
08:56:09.000000000 +0200
@@ -39,6 +39,7 @@
       Yast.include include_target, "drbd/dialogs.rb"
       Yast.include include_target, "drbd/startup_conf.rb"
       Yast.include include_target, "drbd/global_conf.rb"
+      Yast.include include_target, "drbd/lvm_conf.rb"
       Yast.include include_target, "drbd/resource_conf.rb"
     end
 
@@ -46,7 +47,8 @@
       _Aliases = {
         "startup_conf"  => lambda { ConfigureStartUpDialog() },
         "global_conf"   => lambda { ConfigureGlobalDialog() },
-        "resource_conf" => lambda { ResourceSequence() }
+        "resource_conf" => lambda { ResourceSequence() },
+        "lvm_conf" => lambda { ConfigureLVMDialog() }
       }
 
       anywhere = { :abort => :abort, :next => :next }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/modules/Drbd.rb 
new/yast2-drbd-3.1.12/src/modules/Drbd.rb
--- old/yast2-drbd-3.1.11/src/modules/Drbd.rb   2014-12-22 04:16:17.000000000 
+0100
+++ new/yast2-drbd-3.1.12/src/modules/Drbd.rb   2015-05-15 08:56:09.000000000 
+0200
@@ -40,6 +40,8 @@
       Yast.import "Report"
       Yast.import "Summary"
       Yast.import "Service"
+      Yast.import "SuSEFirewall"
+      Yast.import "SuSEFirewallServices"
 
       Yast.import "Mode"
       Yast.import "PackageSystem"
@@ -47,6 +49,8 @@
       @proposal_valid = false
       @modified = false
       @global_config = {}
+      @lvm_config = {}
+      @auto_lvm_filter = true
       @resource_config = {}
       @drbd_dir = "/etc"
       @start_daemon = false
@@ -65,6 +69,10 @@
         ],
         "startup" => ["wfc-timeout", "degr-wfc-timeout"]
       }
+      @local_hostname = ""
+      @local_ports = []
+      @local_disks_ori = []
+      @local_disks_added = []
 
       @global_error = ""
     end
@@ -128,6 +136,49 @@
       true
     end
 
+    def finding_local(section)
+      # Get hostname to find out the local disk/port/IP
+      out = Convert.to_map(
+        SCR.Execute(
+          path(".target.bash_output"),
+          "echo -n `uname -n`"
+        )
+      )
+      # strip is necessary
+      @local_hostname = Ops.get_string(out, "stdout", "")
+      Builtins.y2milestone("Local hostname is %1", @local_hostname)
+
+      # Find all disks and ports of local node
+      @resource_config.each do |resname, resconfig|
+        Builtins.y2debug("Resconf %1 has config %2 ",
+          resname, resconfig)
+
+        resconfig["on"].each do |nodename, conf|
+          if @local_hostname == nodename
+            if section == "disk"
+              disk = conf["disk"]
+              Builtins.y2debug("Using local disk %1 for DRBD.", disk)
+              if !@local_disks_ori.include?(disk)
+                @local_disks_ori.push(disk)
+              end
+
+            elsif section == "port"
+              port = conf["address"].split(":")[1]
+              Builtins.y2debug("Using port %1 for DRBD.", port)
+              if !@local_ports.include?(port)
+                @local_ports.push(port)
+              end
+            end
+
+            break
+          end
+        end
+
+      end
+
+      nil
+    end
+
     def Read
       # DRBD read dialog caption
       caption = _("Initializing DRBD Configuration")
@@ -136,16 +187,20 @@
       Progress.New(
         caption,
         " ",
-        4,
+        5,
         [
           _("Read global settings"),
           _("Read resources"),
-          _("Read daemon status")
+          _("Read LVM configurations"),
+          _("Read daemon status"),
+          _("Read SuSEFirewall Settings")
         ],
         [
           _("Reading global settings..."),
           _("Reading resources..."),
+          _("Reading LVM configurations..."),
           _("Reading daemon status..."),
+          _("Read SuSEFirewall Settings"),
           _("Finished")
         ],
         ""
@@ -256,6 +311,27 @@
           Ops.set(@global_config, "dialog-refresh", "1")
         end
 
+        #read LVM configs via /etc/lvm/lvm.conf
+        #All of them under "devices" section
+        ["filter", "write_cache_state", "cache_dir"].each do |key|
+          val = Convert.to_string(
+            
SCR.Read(Builtins.topath(Builtins.sformat(".drbd_lvm.value.devices.%1", key)))
+          )
+          Ops.set(@lvm_config, key, val)
+          Builtins.y2debug("drbd_lvm.devices.%1 is %2", key, val)
+        end
+
+        if Ops.get(@lvm_config, "filter") == nil
+          # The default value is get from HA doc
+          Ops.set(@lvm_config, "filter", "[ \"r|/dev/sda.*|\" ]")
+        end
+        if Ops.get(@lvm_config, "write_cache_state") == nil
+          Ops.set(@lvm_config, "write_cache_state", "0")
+        end
+        if Ops.get(@lvm_config, "cache_dir") == nil
+          Ops.set(@lvm_config, "cache_dir", "/etc/lvm/cache")
+        end
+
         #read resources configs
         res_names = SCR.Dir(Builtins.topath(".drbd.resources"))
         Builtins.foreach(res_names) do |resname|
@@ -345,11 +421,20 @@
 
       Builtins.y2milestone("read resource_config=%1", @resource_config)
 
+      # Find all info like disks belong to local node
+      finding_local("disk")
+
       Progress.NextStage
       @start_daemon = Service.Enabled("drbd")
 
       Progress.NextStage
 
+      # read the SuSEfirewall2
+      SuSEFirewall.Read
+
+      # Progress finished
+      Progress.NextStage
+
       Progress.Finish
       @modified = false
       true
@@ -485,6 +570,52 @@
       true
     end
 
+    def format_lvm_filter()
+      Builtins.y2milestone("Change LVM filter automatically.")
+
+      filter_list = []
+      r_format = "\"r|%s|\""
+      reject_list = [ "\"r|/dev/block/.*|\"", "\"r|/dev/.*/by-path/.*|\"",
+                      "\"r|/dev/.*/by-id/.*|\"" ]
+      filter_ori = Ops.get(@lvm_config, "filter").to_s.strip()
+      Builtins.y2debug("Original filter is %1", filter_ori)
+
+      # Remove the [] and convert string to list to check
+      temp_length = filter_ori.length - 2
+      if temp_length < 1
+        # Should at least including "[]"
+        filter_str = ""
+      else
+        filter_str = filter_ori[1,temp_length]
+      end
+
+      filter_list_tmp = filter_str.split(",")
+
+      # Remove the extra space in filter field
+      # [].push is FIFO, insert(0,x) is stack
+      filter_list_tmp.each do |field|
+        filter_list.push(field.strip())
+      end
+
+      reject_list.each do |regular|
+        if !filter_list.include?(regular)
+          filter_list.insert( 0, regular )
+        end
+      end
+      Builtins.y2debug("Temp filter list is %1", filter_list)
+
+      @local_disks_added.each do |newdisk|
+        # Reject always need to be added in the first
+        filter_list.insert( 0, r_format % newdisk )
+      end
+
+      filters = "[ " + filter_list.join(", ") + " ]"
+      Builtins.y2debug("Modified filter is %1", filters)
+      Ops.set(@lvm_config, "filter", filters)
+
+      nil
+    end
+
     def Write
       # DRBD write dialog caption
       caption = _("Writing DRBD Configuration")
@@ -497,16 +628,20 @@
       Progress.New(
         caption,
         " ",
-        4,
+        5,
         [
           _("Write global settings"),
           _("Write resources"),
-          _("Set daemon status")
+          _("Write LVM configurations"),
+          _("Set daemon status"),
+          _("Write the SuSEfirewall settings")
         ],
         [
           _("Writing global settings..."),
           _("Writing resources..."),
+          _("Writing LVM configurations..."),
           _("Setting daemon status..."),
+          _("Writing the SuSEFirewall settings"),
           _("Finished")
         ],
         ""
@@ -539,6 +674,37 @@
         end
       end
 
+      #LVM config here
+      #http://docserv.suse.de/documents/SLE-HA11/SLE-ha-nfs-quick/html/
+      #art_ha_quick_nfs.html#sec_ha_quick_nfs_initial_lvm_config
+      Progress.NextStage
+      Builtins.y2debug(
+        "to write lvm config: lvm_config=%1",
+        @lvm_config
+      )
+
+      # Change(add reject rules) filter automatically
+      if @auto_lvm_filter && !@local_disks_added.empty?
+        format_lvm_filter
+      end
+
+      ["filter", "write_cache_state"].each do |key|
+        if Ops.get(@lvm_config, key) != nil
+          SCR.Write(
+            Builtins.topath(Builtins.sformat(".drbd_lvm.value.devices.%1", 
key)),
+            Ops.get(@lvm_config, key)
+          )
+        end
+      end
+
+      if Ops.get(@lvm_config, "write_cache_state") == "0"
+        SCR.Execute(
+          path(".target.bash"),
+          Builtins.sformat("/bin/rm -r %1/.cache >/dev/null 2>&1",
+          Ops.get(@lvm_config, "cache_dir"))
+        )
+      end
+
       #resource config here
       Progress.NextStage
       @resource_config = del_empty_item(@resource_config)
@@ -576,6 +742,19 @@
       end
       Progress.NextStage
 
+      # open all local ports
+      finding_local("port")
+
+      # DRBD only use TCP port
+      SuSEFirewallServices.SetNeededPortsAndProtocols(
+        "service:drbd",
+        { "tcp_ports" => @local_ports }
+      )
+
+      SuSEFirewall.Write
+
+      # Progress finished
+      Progress.NextStage
       Progress.Finish
       true
     end
@@ -583,10 +762,16 @@
     publish :variable => :proposal_valid, :type => "boolean"
     publish :variable => :modified, :type => "boolean"
     publish :variable => :global_config, :type => "map"
+    publish :variable => :lvm_config, :type => "map"
+    publish :variable => :auto_lvm_filter, :type => "boolean"
     publish :variable => :resource_config, :type => "map"
     publish :variable => :drbd_dir, :type => "string"
     publish :variable => :start_daemon, :type => "boolean"
     publish :variable => :config_name, :type => "map <string, list <string>>"
+    publish :variable => :local_hostname, :type => "string"
+    publish :variable => :local_ports, :type => "list <string>"
+    publish :variable => :local_disks_ori, :type => "list <string>"
+    publish :variable => :local_disks_added, :type => "list <string>"
     publish :variable => :global_error, :type => "string"
     publish :function => :Read, :type => "boolean ()"
     publish :function => :Write, :type => "boolean ()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-drbd-3.1.11/src/scrconf/drbd_lvm.scr 
new/yast2-drbd-3.1.12/src/scrconf/drbd_lvm.scr
--- old/yast2-drbd-3.1.11/src/scrconf/drbd_lvm.scr      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-drbd-3.1.12/src/scrconf/drbd_lvm.scr      2015-05-15 
08:56:09.000000000 +0200
@@ -0,0 +1,29 @@
+/**
+ * File:
+ *   drbd_lvm.scr
+ * Summary:
+ *   Limited reading/writing /etc/lvm/lvm.conf
+ *   using the ini-agent.
+ *   Refer to 'man lvm.conf' for further information
+ *   including the file layout.
+ */
+
+.drbd_lvm
+
+`ag_ini(
+       `IniAgent(
+               "/etc/lvm/lvm.conf",
+           $[
+                       "options" : ["line_can_continue"],
+                       "comments": ["^[ \t]*#.*", "#.*", "^[ \t]*$"],
+                       "sections": [
+                               $[
+                                       "begin" : ["^[ \t]*(.*[^ \t])[ \t]*\\{[ 
\t]*","%s {"] ,
+                                       "end"   : ["^[ \t]*\\}[ \t]*", "}"]
+                                ]
+                       ],
+                       "params"  : [$["match" : ["^[ \t]*([a-zA-Z0-9_]+)[ 
\t]*=[ \t]*(.+)[ \t]*$", "%s = %s"]]],
+                       "subindent" : "\t"
+               ]
+  )
+)


Reply via email to