Hello community,

here is the log from the commit of package yast2-geo-cluster for 
openSUSE:Factory checked in at 2017-10-24 22:24:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-geo-cluster (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-geo-cluster.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-geo-cluster"

Tue Oct 24 22:24:34 2017 rev:16 rq:536232 version:4.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-geo-cluster/yast2-geo-cluster.changes      
2017-03-12 20:02:36.257606625 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-geo-cluster.new/yast2-geo-cluster.changes 
2017-10-24 22:24:38.616863855 +0200
@@ -1,0 +2,12 @@
+Thu Sep 28 09:07:29 UTC 2017 - [email protected]
+
+- fate#323960, support manual tickets mode.
+- Version 4.0.1
+
+-------------------------------------------------------------------
+Thu Sep 14 15:27:03 UTC 2017 - [email protected]
+
+- fate#323863. support autoyast.
+- Version 4.0.0
+
+-------------------------------------------------------------------

Old:
----
  yast2-geo-cluster-3.2.0.tar.bz2

New:
----
  yast2-geo-cluster-4.0.1.tar.bz2

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

Other differences:
------------------
++++++ yast2-geo-cluster.spec ++++++
--- /var/tmp/diff_new_pack.BANeTz/_old  2017-10-24 22:24:39.224835434 +0200
+++ /var/tmp/diff_new_pack.BANeTz/_new  2017-10-24 22:24:39.224835434 +0200
@@ -17,13 +17,14 @@
 
 
 Name:           yast2-geo-cluster
-Version:        3.2.0
+Version:        4.0.1
 Release:        0
 
 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
 
+Requires:       autoyast2-installation
 Requires:       yast2
 BuildRequires:  perl-XML-Writer
 BuildRequires:  update-desktop-files
@@ -61,6 +62,7 @@
 %{yast_desktopdir}/geo-cluster.desktop
 %{yast_scrconfdir}/*.scr
 %{yast_agentdir}/ag_booth
+%{yast_schemadir}/autoyast/rnc/geo-cluster.rnc
 %doc %{yast_docdir}
 
 %changelog

++++++ yast2-geo-cluster-3.2.0.tar.bz2 -> yast2-geo-cluster-4.0.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/package/yast2-geo-cluster.changes 
new/yast2-geo-cluster-4.0.1/package/yast2-geo-cluster.changes
--- old/yast2-geo-cluster-3.2.0/package/yast2-geo-cluster.changes       
2017-03-07 09:51:13.619480491 +0100
+++ new/yast2-geo-cluster-4.0.1/package/yast2-geo-cluster.changes       
2017-10-23 11:06:43.614271147 +0200
@@ -1,4 +1,16 @@
 -------------------------------------------------------------------
+Thu Sep 28 09:07:29 UTC 2017 - [email protected]
+
+- fate#323960, support manual tickets mode.
+- Version 4.0.1
+
+-------------------------------------------------------------------
+Thu Sep 14 15:27:03 UTC 2017 - [email protected]
+
+- fate#323863. support autoyast.
+- Version 4.0.0
+
+-------------------------------------------------------------------
 Wed Mar  1 10:15:02 UTC 2017 - [email protected]
 
 - bsc#1027405. Move the firewall rule file to booth.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/package/yast2-geo-cluster.spec 
new/yast2-geo-cluster-4.0.1/package/yast2-geo-cluster.spec
--- old/yast2-geo-cluster-3.2.0/package/yast2-geo-cluster.spec  2017-03-07 
09:51:13.619480491 +0100
+++ new/yast2-geo-cluster-4.0.1/package/yast2-geo-cluster.spec  2017-10-23 
11:06:43.614271147 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-geo-cluster
-Version:        3.2.0
+Version:        4.0.1
 Release:        0
 
 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
@@ -25,6 +25,7 @@
 Source0:        %{name}-%{version}.tar.bz2
 
 Requires:       yast2
+Requires:       autoyast2-installation
 BuildRequires:  perl-XML-Writer
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2
@@ -61,6 +62,7 @@
 %{yast_desktopdir}/geo-cluster.desktop
 %{yast_scrconfdir}/*.scr
 %{yast_agentdir}/ag_booth
+%{yast_schemadir}/autoyast/rnc/geo-cluster.rnc
 %doc %{yast_docdir}
 
 %changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-geo-cluster-3.2.0/src/Makefile.am 
new/yast2-geo-cluster-4.0.1/src/Makefile.am
--- old/yast2-geo-cluster-3.2.0/src/Makefile.am 2017-03-07 09:51:13.631480491 
+0100
+++ new/yast2-geo-cluster-4.0.1/src/Makefile.am 2017-10-23 11:06:43.614271147 
+0200
@@ -26,6 +26,10 @@
 agent_SCRIPTS = \
   servers_non_y2/ag_booth
 
-EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(desktop_DATA) 
$(scrconf_DATA) $(agent_SCRIPTS)
+schemafilesdir = $(schemadir)/autoyast/rnc
+schemafiles_DATA = \
+  autoyast-rnc/geo-cluster.rnc
+
+EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(desktop_DATA) 
$(scrconf_DATA) $(agent_SCRIPTS) $(schemafiles_DATA)
 
 include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/src/autoyast-rnc/geo-cluster.rnc 
new/yast2-geo-cluster-4.0.1/src/autoyast-rnc/geo-cluster.rnc
--- old/yast2-geo-cluster-3.2.0/src/autoyast-rnc/geo-cluster.rnc        
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-geo-cluster-4.0.1/src/autoyast-rnc/geo-cluster.rnc        
2017-10-23 11:06:43.614271147 +0200
@@ -0,0 +1,73 @@
+default namespace = "http://www.suse.com/1.0/yast2ns";
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0";
+namespace config = "http://www.suse.com/1.0/configns";
+
+# Refer to common.rnc in /usr/share/YaST2/schema/autoyast/rnc
+LIST = attribute config:type { "list" }
+
+geo-cluster =
+  element geo-cluster {
+      LIST,
+      booth_config*
+  }
+
+int_noempty = xsd:integer | empty
+
+filename = element filename { text }
+authfile = element authfile { text }
+port = element port { int_noempty }
+transport = element transport { text }
+
+simple_listentry = element listentry { text }
+
+arbitrators =
+  element arbitrator {
+      LIST,
+      simple_listentry*
+  }
+
+sites =
+  element site {
+      LIST,
+      simple_listentry*
+  }
+
+acquire-after = element acquire-after { int_noempty }
+before-acquire-handler = element before-acquire-handler { text }
+expire = element expire { int_noempty }
+retries = element retries { int_noempty }
+ticketname = element ticketname { text }
+timeout = element timeout { int_noempty }
+weights = element weights { int_noempty }
+mode = element mode { text }
+
+ticket_listentry =
+  element listentry {
+      acquire-after? &
+      before-acquire-handler? &
+      expire? &
+      retries? &
+      ticketname? &
+      timeout? &
+      weights? &
+      mode?
+  }
+
+tickets =
+  element ticket {
+      LIST,
+      ticket_listentry*
+  }
+
+booth_config =
+  element listentry {
+      filename? &
+      authfile? &
+      port? &
+      transport? &
+      arbitrators? &
+      sites? &
+      tickets?
+  }
+
+start = geo-cluster
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/src/clients/geo-cluster_auto.rb 
new/yast2-geo-cluster-4.0.1/src/clients/geo-cluster_auto.rb
--- old/yast2-geo-cluster-3.2.0/src/clients/geo-cluster_auto.rb 2017-03-07 
09:51:13.631480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/clients/geo-cluster_auto.rb 2017-10-23 
11:06:43.614271147 +0200
@@ -56,9 +56,10 @@
       if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
           Ops.is_string?(WFM.Args(0))
         @func = Convert.to_string(WFM.Args(0))
+
         if Ops.greater_than(Builtins.size(WFM.Args), 1) &&
-            Ops.is_map?(WFM.Args(1))
-          @param = Convert.to_map(WFM.Args(1))
+            Ops.is_list?(WFM.Args(1))
+          @param = Convert.to_list(WFM.Args(1))
         end
       end
       Builtins.y2debug("func=%1", @func)
@@ -66,44 +67,44 @@
 
       # Create a summary
       if @func == "Summary"
-        @ret = Ops.get_string(geo-cluster.Summary, 0, "")
+        @ret = GeoCluster.Summary
       # Reset configuration
       elsif @func == "Reset"
-        geo-cluster.Import({})
+        GeoCluster.Import({})
         @ret = {}
       # Change configuration (run AutoSequence)
       elsif @func == "Change"
         @ret = GeoClusterAutoSequence()
       # Import configuration
       elsif @func == "Import"
-        @ret = geo-cluster.Import(@param)
+        @ret = GeoCluster.Import(@param)
       # Return actual state
       elsif @func == "Export"
-        @ret = geo-cluster.Export
+        @ret = GeoCluster.Export
       # Return needed packages
       elsif @func == "Packages"
-        @ret = geo-cluster.AutoPackages
+        @ret = GeoCluster.AutoPackages
       # Read current state
       elsif @func == "Read"
         Yast.import "Progress"
         @progress_orig = Progress.set(false)
-        @ret = geo-cluster.Read
+        @ret = GeoCluster.Read
         Progress.set(@progress_orig)
-      # Write givven settings
+      # Write given settings
       elsif @func == "Write"
         Yast.import "Progress"
         @progress_orig = Progress.set(false)
-        geo-cluster.SetWriteOnly(true)
-        @ret = geo-cluster.Write
+        GeoCluster.SetWriteOnly(true)
+        @ret = GeoCluster.Write
         Progress.set(@progress_orig)
       # did configuration changed
       # return boolean
       elsif @func == "GetModified"
-        @ret = geo-cluster.Modified
+        @ret = GeoCluster.Modified
       # set configuration as changed
       # return boolean
       elsif @func == "SetModified"
-        geo-cluster.SetModified(true)
+        GeoCluster.SetModified(true)
         @ret = true
       else
         Builtins.y2error("Unknown function: %1", @func)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/src/desktop/geo-cluster.desktop 
new/yast2-geo-cluster-4.0.1/src/desktop/geo-cluster.desktop
--- old/yast2-geo-cluster-3.2.0/src/desktop/geo-cluster.desktop 2017-03-07 
09:51:13.647480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/desktop/geo-cluster.desktop 2017-10-23 
11:06:43.614271147 +0200
@@ -10,10 +10,13 @@
 X-SuSE-YaST-Group=High_Availability
 X-SuSE-YaST-Argument=
 X-SuSE-YaST-RootOnly=true
-X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-AutoInst=all
+X-SuSE-YaST-AutoInstDataType=list
+X-SuSE-YaST-AutoInstClonable=true
 X-SuSE-YaST-Geometry=
 X-SuSE-YaST-SortKey=
 X-SuSE-YaST-AutoInstResource=geo-cluster
+X-SuSE-YaST-AutoInstSchema=geo-cluster.rnc
 
 Icon=yast-geo-cluster
 Exec=/sbin/yast2 geo-cluster 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/src/include/geo-cluster/complex.rb 
new/yast2-geo-cluster-4.0.1/src/include/geo-cluster/complex.rb
--- old/yast2-geo-cluster-3.2.0/src/include/geo-cluster/complex.rb      
2017-03-07 09:51:13.651480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/include/geo-cluster/complex.rb      
2017-10-23 11:06:43.618271147 +0200
@@ -82,11 +82,6 @@
       # GeoCluster summary dialog caption
       caption = _("Geo Cluster Configuration")
 
-      # FIXME
-      summary = GeoCluster.Summary
-      unconfigured = Ops.get_list(summary, 1, [])
-      configured = Ops.get_string(summary, 0, "")
-
       # Frame label
       contents = nil
       #Wizard_hw::DetectedContent(_("GeoCluster to Configure"),
@@ -142,8 +137,6 @@
       # GeoCluster overview dialog caption
       caption = _("Geo Cluster Overview")
 
-      overview = GeoCluster.Overview
-
       # FIXME table header
       contents = nil
       #Wizard_hw::ConfiguredContent(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/src/include/geo-cluster/dialogs.rb 
new/yast2-geo-cluster-4.0.1/src/include/geo-cluster/dialogs.rb
--- old/yast2-geo-cluster-3.2.0/src/include/geo-cluster/dialogs.rb      
2017-03-07 09:51:13.651480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/include/geo-cluster/dialogs.rb      
2017-10-23 11:06:43.618271147 +0200
@@ -91,7 +91,7 @@
         ),
         VBox(
           Left(Label(_("ticket"))),
-          Table(Id(:ticket_box), Header("ticket", "timeout", "retries", 
"weights", "expire", "acquire-after", "before-acquire-handler"), []),
+          Table(Id(:ticket_box), Header("ticket", "mode", "timeout", 
"retries", "weights", "expire", "acquire-after", "before-acquire-handler"), []),
           Left(
             HBox(
               PushButton(Id(:ticket_add), "Add"),
@@ -213,6 +213,7 @@
       weights = ""
       expire = ""
       beforeah = ""
+      ticketmode = ""
 
       if ticket_hash != {}
         if ticket_hash.size != 1
@@ -227,9 +228,18 @@
           weights = Ops.get_string(value,"weights","")
           expire = Ops.get_string(value,"expire","")
           beforeah = Ops.get_string(value,"before-acquire-handler","")
+          ticketmode = Ops.get_string(value,"mode","")
         end
       end
 
+      # Since ag_booth only return "MANUAL"/"AUTOMATIC"/""
+      # Not really necessary for "manual" atm, but it may change in future
+      if ticketmode == "MANUAL" || ticketmode == "manual"
+        isManual = true
+      else
+        isManual = false
+      end
+
       UI.OpenDialog(
         MarginBox(
           1,
@@ -241,6 +251,8 @@
             ),
             VSpacing(1),
             HBox(
+              CheckBox(Id(:tmode), Opt(:notify), _("Manual mode"), isManual),
+              HSpacing(2),
               InputField(Id(:timeout), Opt(:hstretch), _("timeout"), timeout),
               HSpacing(2),
               InputField(Id(:retries), Opt(:hstretch), _("retries"), retries),
@@ -287,6 +299,12 @@
           num_retries = Builtins.tointeger(retries)
           num_weights = Builtins.tointeger(weights)
 
+          if UI.QueryWidget(:tmode, :Value)
+            ticketmode = "MANUAL"
+          else
+            ticketmode = "AUTOMATIC"
+          end
+
           if num_timeout == nil && timeout != ""
             Popup.Message(_("timeout is invalid"))
           elsif num_expire == nil && expire != ""
@@ -309,6 +327,7 @@
             temp_ticket["retries"] = retries
             temp_ticket["weights"] = weights
             temp_ticket["before-acquire-handler"] = beforeah
+            temp_ticket["mode"] = ticketmode
 
             ret = {ticket => deep_copy(temp_ticket)}
             break
@@ -323,7 +342,6 @@
     #fill arbitrator_box with global_arbitrators
     def fill_arbitrators_entries(arbitrators)
       i = 0
-      ret = 0
       current = 0
       items = []
       arbitrators.each do |arbitrator|
@@ -341,7 +359,6 @@
     #fill site_box with global_site
     def fill_sites_entries(sites)
       i = 0
-      ret = 0
       current = 0
       items = []
       sites.each do |site|
@@ -359,7 +376,6 @@
     #fill ticket_box with global_ticket
     def fill_ticket_entries(tickets)
       i = 0
-      ret = 0
       current = 0
       items = []
 
@@ -372,8 +388,10 @@
           weights = Ops.get_string(value,"weights","")
           expire = Ops.get_string(value,"expire","")
           beforeah = Ops.get_string(value,"before-acquire-handler","")
+          ticketmode = Ops.get_string(value,"mode","")
 
-          items = items.push(Item(Id(i), tname, timeout, retries, weights, 
expire, acquireafter, beforeah))
+          items = items.push(Item(Id(i), tname, ticketmode, timeout,
+                    retries, weights, expire, acquireafter, beforeah))
           i += 1
         end
       end
@@ -388,7 +406,6 @@
     #fill confs with global_files
     def fill_conf_entries
       i = 0
-      ret = 0
       current = 0
       items = []
       conf_list = []
@@ -430,11 +447,7 @@
         }
       )
       firewall_layout = Ops.get_term(firewall_widget, "custom_widget", VBox())
-      contents = VBox(
-        VSpacing(1),
-        Frame("firewall settings", firewall_layout),
-        VStretch()
-      )
+
       Wizard.SetContents(
         caption,
         firewall_layout,
@@ -679,19 +692,33 @@
             next
           end
 
-          #Same to UI.QueryWidget(:arbitrator_box, :Value).to_s == ""
-          if temp_arbitrator.size == 0
-            Popup.Message(_("arbitrator have to be filled!"))
+          if temp_ticket.size == 0
+            Popup.Message(_("ticket have to be filled!"))
             next
           end
 
-          if temp_site.size == 0
-            Popup.Message(_("site have to be filled!"))
+          hasAutoTicket = false
+
+          temp_ticket.each do |ticket|
+            ticket.each_value do |value|
+              tmode = value.fetch("mode", "AUTOMATIC")
+              if tmode != "MANUAL" && tmode != "manual"
+                hasAutoTicket = true
+                break
+              end
+            end
+          end
+
+          if temp_arbitrator.size == 0 && hasAutoTicket &&
+            0 == temp_site.size % 2
+            Popup.Message(_("arbitrator have to be filled when even \
+number of sites with normal automatic ticket!"))
             next
           end
 
-          if temp_ticket.size == 0
-            Popup.Message(_("ticket have to be filled!"))
+          #Same to UI.QueryWidget(:site_box, :Value).to_s == ""
+          if temp_site.size == 0
+            Popup.Message(_("site have to be filled!"))
             next
           end
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-geo-cluster-3.2.0/src/include/geo-cluster/helps.rb 
new/yast2-geo-cluster-4.0.1/src/include/geo-cluster/helps.rb
--- old/yast2-geo-cluster-3.2.0/src/include/geo-cluster/helps.rb        
2017-03-07 09:51:13.663480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/include/geo-cluster/helps.rb        
2017-10-23 11:06:43.618271147 +0200
@@ -63,6 +63,12 @@
             "The ticket name, which corresponds to a set of resources which 
can be<br>\n" +
             "fail-overed among different sites. Use the '__default__' ticket 
to set<br>\n" +
             "the default value of ticket\n" +
+            "<p>" +
+          "<p><b>ticket mode</b><br>\n" +
+            "Specifies if the ticket is MANUAL or AUTOMATIC. <br>Default mode 
is AUTOMATIC. <br>\n" +
+            "Notice: Automatic ticket management provided by Raft algorithm 
doesn't apply " +
+            "to manually controlled tickets. In particular, there is no 
elections, " +
+            "automatic failover procedures, and term expiration." +
             "<p>",
         "geo-cluster" => "<p><b>Firewall Settings</b><br> \n" +
           "Enable the port when Firewall is enabled.\n" +
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-geo-cluster-3.2.0/src/modules/GeoCluster.rb 
new/yast2-geo-cluster-4.0.1/src/modules/GeoCluster.rb
--- old/yast2-geo-cluster-3.2.0/src/modules/GeoCluster.rb       2017-03-07 
09:51:13.683480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/modules/GeoCluster.rb       2017-10-23 
11:06:43.618271147 +0200
@@ -77,7 +77,7 @@
       # Empty "authfile" means disable authentication
       @global_conf_single = { "transport" => "UDP", "port" => "9929", 
"authfile" => "" }
       @global_conf_list = [ "arbitrator", "site" ]
-      @global_conf_ticket = { "expire" => "", "acquire-after" => "", "timeout" 
=> "", "retries" => "", "weights" => "", "before-acquire-handler" => ""}
+      @global_conf_ticket = { "expire" => "", "acquire-after" => "", "timeout" 
=> "", "retries" => "", "weights" => "", "before-acquire-handler" => "", "mode" 
=> "" }
       @global_del_confs = []
     end
 
@@ -168,7 +168,7 @@
     def empty_ticket(ticket)
       empty = true
       @global_conf_ticket.each_key do |key|
-        empty = false if ticket[key] != ""
+        empty = false if ticket[key] && ticket[key] != ""
       end
       empty
     end
@@ -221,6 +221,11 @@
       @global_conf_single.each_key do |key|
         Builtins.y2milestone("Writing global_conf %1 = %2\n", key, conf[key])
 
+        if !conf[key]
+          Builtins.y2debug("Skip the nil conf: %1 = %2\n", key, conf[key])
+          next
+        end
+
         if key == "authfile"
           # SCR won't write authfile when empty("")
           # Convert relative path to absolute path
@@ -268,6 +273,11 @@
           error_flag = true if !ret
         else
           @global_conf_ticket.each_key do |key|
+            if !value[key]
+              Builtins.y2debug("Skip the nil ticket settings: %1 = %2\n", key, 
value[key])
+              next
+            end
+
             ret = 
SCR.Write((temp_ticket_path+Builtins.topath(tname)+Builtins.topath(key)), 
value[key])
             Builtins.y2milestone("Writing ticket settings: %1 = %2\n", key, 
value[key])
             error_flag = true if !ret
@@ -341,7 +351,6 @@
     def Write
       # GeoCluster write dialog caption
       caption = _("Saving Geo Cluster Configuration")
-      ret = false
 
       # TODO FIXME And set the right number of stages
       steps = 2
@@ -431,24 +440,108 @@
     # @return [Boolean] True on success
     def Import(settings)
       settings = deep_copy(settings)
-      # TODO FIXME: your code here (fill the above mentioned variables)...
+
+      if settings != nil
+        @global_files = {}
+
+        settings.each do |booth_xml|
+          conf = {}
+
+          confname = booth_xml["filename"]
+          @global_conf_single.each_key do |key|
+            conf[key] = booth_xml[key]
+          end
+
+          @global_conf_list.each do |key|
+            conf[key] = booth_xml[key]
+          end
+
+          all_tickets = {}
+          booth_xml["ticket"].each do |ticket_xml|
+            tmp_ticket = {}
+
+            ticketname = ticket_xml["ticketname"]
+            @global_conf_ticket.each_key do |key|
+              tmp_ticket[key] = ticket_xml[key]
+            end
+
+            all_tickets[ticketname] = tmp_ticket
+          end
+          conf["ticket"] = all_tickets
+
+          @global_files[confname] = conf
+        end
+
+      end
+
+      Builtins.y2milestone("Import: %1", @global_files)
+
       true
     end
 
-    # Dump the geo-cluster settings to a single map
+    # Dump the geo-cluster settings to a list
     # (For use by autoinstallation.)
     # @return [Hash] Dumped settings (later acceptable by Import ())
     def Export
-      # TODO FIXME: your code here (return the above mentioned variables)...
-      {}
+      # Use list instead of hash, since should "Avoid using configuration
+      # data as the key in a hash key/value pair."
+      # refer: 
https://yastgithubio.readthedocs.io/en/latest/autoyast-development/
+      ret = []
+
+      @global_files.each_key do |filename|
+        booth_conf = @global_files[filename]
+
+        tmp_conf = {}
+        tmp_conf["filename"] = filename
+
+        @global_conf_single.each_key do |key|
+          tmp_conf[key] = booth_conf[key]
+        end
+
+        @global_conf_list.each do |key|
+          tmp_conf[key] = booth_conf[key]
+        end
+
+        ticket = []
+        booth_conf["ticket"].each do |tname, value|
+          tmp_ticket = {}
+          ticket_conf = booth_conf["ticket"][tname]
+
+          tmp_ticket["ticketname"] = tname
+          @global_conf_ticket.each_key do |key|
+            tmp_ticket[key] = ticket_conf[key]
+          end
+
+          ticket.push(tmp_ticket)
+        end
+
+        tmp_conf["ticket"] = ticket
+
+        ret.push(tmp_conf)
+      end
+
+      deep_copy(ret)
     end
 
     # Create a textual summary and a list of unconfigured cards
     # @return summary of the current configuration
     def Summary
-      # TODO FIXME: your code here...
-      # Configuration summary text for autoyast
-      [_("Configuration summary..."), []]
+      summary = Summary.AddHeader("", _("Configuration Summary"))
+
+      Builtins.y2milestone("Summary: %1", @global_files)
+
+      if @global_files.size > 0
+        @global_files.each_key do |conf, value|
+          summary = Summary.AddLine(
+            summary,
+            "Configuration file #{conf}."
+          )
+        end
+      else
+        summary = Summary.AddLine(summary, Summary.NotConfigured)
+      end
+
+      summary
     end
 
     # Create an overview table with all configured cards
@@ -463,8 +556,7 @@
     # installed.
     # @return [Hash] with 2 lists.
     def AutoPackages
-      # TODO FIXME: your code here...
-      { "install" => [], "remove" => [] }
+      { "install" => ["booth"], "remove" => [] }
     end
 
     publish :function => :Modified, :type => "boolean ()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-geo-cluster-3.2.0/src/servers_non_y2/ag_booth 
new/yast2-geo-cluster-4.0.1/src/servers_non_y2/ag_booth
--- old/yast2-geo-cluster-3.2.0/src/servers_non_y2/ag_booth     2017-03-07 
09:51:13.695480491 +0100
+++ new/yast2-geo-cluster-4.0.1/src/servers_non_y2/ag_booth     2017-10-23 
11:06:43.618271147 +0200
@@ -45,6 +45,7 @@
 valid_tables = {
        "port":{ "type":"int", "default":9929 },
        "transport":{ "valid":("UDP", "TCP"), "ignore_case":True, 
"default":"UDP" },
+       "mode":{ "valid":("MANUAL", "AUTOMATIC"), "ignore_case":True, 
"default":"AUTOMATIC" },
        # Ignore default number, due to __default__ ticket may exist
        "expire":{ "type":"int" },
        "acquire-after":{ "type":"int" },
@@ -57,7 +58,7 @@
 
 single_var = ("port", "transport", "site-user", "site-group", 
"arbitrator-user", "arbitrator-group", "authfile")
 list_var = ("arbitrator", "site")
-ticket_include = ("ticket", "expire", "acquire-after", "timeout", "retries", 
"weights", "before-acquire-handler")
+ticket_include = ("ticket", "expire", "acquire-after", "timeout", "retries", 
"weights", "before-acquire-handler", "mode")
 
 #ticket_template = {
 #      "expire":"",
@@ -66,6 +67,7 @@
 #      "retries":"",
 #      "weights":"",
 #      "before-acquire-handler":"",
+#      "mode":"manual",
 #      }
 ticket_template = {}
 for key in ticket_include:
@@ -218,7 +220,7 @@
        fd.write("ticket = %s\n" % (t_name))
 
        # ticket group including:
-       # ["timeout", "expire", "acquire-after", "retries", "weights", 
"before-acquire-handler"]:
+       # ["timeout", "expire", "acquire-after", "retries", "weights", 
"before-acquire-handler", "mode"]:
        for var in tuple(ticket_group.keys()):
                if ticket_group[var] != "":
                        #fd.write("#%s\n\n" % (docs.get(var, "")))
@@ -251,14 +253,14 @@
        # {'booth2': {'arbitrator': '147.2.207.199',
        #             'arbitrator': '147.2.207.219',
        #                         'ticket': {'8': {'retries': '', 'expire': 50, 
'acquire-after': 10, 'weights': '', 'timeout': 123, 
'before-acquire-handler':''},
-       #                                                '3': {'retries': '', 
'expire': '', 'acquire-after': '', 'weights': '', 'timeout': ''},
-       #                                                'abd': {'retries': '', 
'expire': 3, 'acquire-after': 10, 'weights': '', 'timeout': ''},
-       #                                                'hello9': {'retries': 
'', 'expire': '', 'acquire-after': '', 'weights': '', 'timeout': ''}},
+       #                                                '3': {'retries': '', 
'expire': '', 'acquire-after': '', 'weights': '', 'timeout': '', 'mode': ''},
+       #                                                'abd': {'retries': '', 
'expire': 3, 'acquire-after': 10, 'weights': '', 'timeout': '', 'mode': 
'AUTOMATIC'},
+       #                                                'hello9': {'retries': 
'', 'expire': '', 'acquire-after': '', 'weights': '', 'timeout': '', 'mode': 
'MANUAL'}},
        #                         'port': 50,
        #                         'transport': 'UDP',
        #                         'site': ['147.2.207.200', '147.2.207.201']},
        #  'booth': {'arbitrator': '147.2.207.199',
-       #                         'ticket': {'3': {'retries': '', 'expire': '', 
'acquire-after': '', 'weights': '', 'timeout': ''}},
+       #                         'ticket': {'3': {'retries': '', 'expire': '', 
'acquire-after': '', 'weights': '', 'timeout': '', 'mode':'AUTOMATIC'}},
        #                         'port': 50,
        #                         'transport': 'UDP',
        #                         'authfile': 'booth.key',


Reply via email to