Hello community, here is the log from the commit of package yast2-geo-cluster for openSUSE:Factory checked in at 2014-07-08 13:02:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-geo-cluster (Old) and /work/SRC/openSUSE:Factory/.yast2-geo-cluster.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-geo-cluster" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-geo-cluster/yast2-geo-cluster.changes 2014-07-02 15:04:46.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-geo-cluster.new/yast2-geo-cluster.changes 2014-07-08 13:02:10.000000000 +0200 @@ -1,0 +2,6 @@ +Tue Jul 8 03:27:06 UTC 2014 - nwang@suse.com + +- BNC3885955. Support multiple arbitrators in one conf. +- Version 3.1.5 + +------------------------------------------------------------------- Old: ---- yast2-geo-cluster-3.1.4.tar.bz2 New: ---- yast2-geo-cluster-3.1.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-geo-cluster.spec ++++++ --- /var/tmp/diff_new_pack.zNy597/_old 2014-07-08 13:02:11.000000000 +0200 +++ /var/tmp/diff_new_pack.zNy597/_new 2014-07-08 13:02:11.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-geo-cluster -Version: 3.1.4 +Version: 3.1.5 Release: 0 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services ++++++ yast2-geo-cluster-3.1.4.tar.bz2 -> yast2-geo-cluster-3.1.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-geo-cluster-3.1.4/package/yast2-geo-cluster.changes new/yast2-geo-cluster-3.1.5/package/yast2-geo-cluster.changes --- old/yast2-geo-cluster-3.1.4/package/yast2-geo-cluster.changes 2014-07-01 04:26:23.000000000 +0200 +++ new/yast2-geo-cluster-3.1.5/package/yast2-geo-cluster.changes 2014-07-08 05:31:32.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jul 8 03:27:06 UTC 2014 - nwang@suse.com + +- BNC3885955. Support multiple arbitrators in one conf. +- Version 3.1.5 + +------------------------------------------------------------------- Thu Jun 26 05:35:15 UTC 2014 - nwang@suse.com - BNC#882820 & BNC#882788. Support multiple confs configure in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-geo-cluster-3.1.4/package/yast2-geo-cluster.spec new/yast2-geo-cluster-3.1.5/package/yast2-geo-cluster.spec --- old/yast2-geo-cluster-3.1.4/package/yast2-geo-cluster.spec 2014-07-01 04:26:23.000000000 +0200 +++ new/yast2-geo-cluster-3.1.5/package/yast2-geo-cluster.spec 2014-07-08 05:31:32.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-geo-cluster -Version: 3.1.4 +Version: 3.1.5 Release: 0 %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-geo-cluster-3.1.4/src/include/geo-cluster/dialogs.rb new/yast2-geo-cluster-3.1.5/src/include/geo-cluster/dialogs.rb --- old/yast2-geo-cluster-3.1.4/src/include/geo-cluster/dialogs.rb 2014-07-01 04:26:23.000000000 +0200 +++ new/yast2-geo-cluster-3.1.5/src/include/geo-cluster/dialogs.rb 2014-07-08 05:31:32.000000000 +0200 @@ -50,21 +50,15 @@ Opt(:hstretch), _("configuration file"), conf - ) - ), - HBox( - InputField( - Id(:arbitrator), - Opt(:hstretch), - _("arbitrator ip"), - Ops.get(GeoCluster.global_files[conf], "arbitrator", "") ), + HSpacing(1), ComboBox( Id(:transport), Opt(:hstretch, :notify), _("transport"), [Ops.get(GeoCluster.global_files[conf], "transport", "UDP")] ), + HSpacing(1), InputField( Id(:port), Opt(:hstretch), @@ -73,6 +67,16 @@ ) ), VBox( + SelectionBox(Id(:arbitrator_box), _("arbitrator")), + Left( + HBox( + PushButton(Id(:arbitrator_add), _("Add")), + PushButton(Id(:arbitrator_edit), _("Edit")), + PushButton(Id(:arbitrator_del), _("Delete")) + ) + ) + ), + VBox( SelectionBox(Id(:site_box), _("site")), Left( HBox( @@ -82,16 +86,16 @@ ) ) ), - VSpacing(1), - VBox( - Left(Label(_("ticket"))), - Table(Id(:ticket_box), Header("ticket", "timeout", "retries", "weights", "expire", "acquire-after", "before-acquire-handler"), []), - Left( - HBox( - PushButton(Id(:ticket_add), "Add"), - PushButton(Id(:ticket_edit), "Edit"), - PushButton(Id(:ticket_del), "Delete")) - )), + VBox( + Left(Label(_("ticket"))), + Table(Id(:ticket_box), Header("ticket", "timeout", "retries", "weights", "expire", "acquire-after", "before-acquire-handler"), []), + Left( + HBox( + PushButton(Id(:ticket_add), "Add"), + PushButton(Id(:ticket_edit), "Edit"), + PushButton(Id(:ticket_del), "Delete")) + ) + ), VBox( Right( HBox( @@ -258,6 +262,24 @@ deep_copy(ret) end + #fill arbitrator_box with global_arbitrators + def fill_arbitrators_entries(arbitrators) + i = 0 + ret = 0 + current = 0 + items = [] + arbitrators.each do |arbitrator| + items = items.push(Item(Id(i), arbitrator)) + i += 1 + end + current = UI.QueryWidget(:arbitrator_box, :CurrentItem).to_i + current = i-1 if current >= i + UI.ChangeWidget(:arbitrator_box, :Items, items) + UI.ChangeWidget(:arbitrator_box, :CurrentItem, current) + + nil + end + #fill site_box with global_site def fill_sites_entries(sites) i = 0 @@ -276,7 +298,7 @@ nil end - #fill site_ticket with global_ticket + #fill ticket_box with global_ticket def fill_ticket_entries(tickets) i = 0 ret = 0 @@ -326,47 +348,6 @@ deep_copy(conf_list) end - def validate - ret = true - if Builtins.size(GeoCluster.global_site) == 0 - Popup.Message(_("site have to be filled")) - return false - end - - if Builtins.size(GeoCluster.global_ticket) == 0 - Popup.Message(_("ticket have to be filled")) - return false - end - - Builtins.foreach(GeoCluster.global_conf) do |key, value| - if key == "arbitrator" - if IP.Check(value) != true - Popup.Message(_("arbitrator IP address is invalid!")) - ret = false - raise Break - end - end - if key == "port" - num = Builtins.tointeger(value) - if num != nil && Ops.greater_than(num, 0) && - Ops.less_or_equal(num, 65535) - next - else - Popup.Message(Builtins.sformat("%1 is invalid", key)) - ret = false - raise Break - end - end - if value == "" - Popup.Message(Builtins.sformat("%1 should be filled", key)) - ret = false - raise Break - end - end - - ret - end - def ServiceDialog ret = nil event = {} @@ -445,9 +426,14 @@ current = 0 temp_site = [] + temp_arbitrator = [] temp_ticket = [] if conf != "" + if GeoCluster.global_files[conf]["arbitrator"] + temp_arbitrator = deep_copy(GeoCluster.global_files[conf]["arbitrator"]) + end + if GeoCluster.global_files[conf]["site"] temp_site = deep_copy(GeoCluster.global_files[conf]["site"]) end @@ -462,6 +448,7 @@ end while true + fill_arbitrators_entries(temp_arbitrator) fill_sites_entries(temp_site) fill_ticket_entries(temp_ticket) @@ -471,6 +458,14 @@ UI.ChangeWidget(Id(:confname), :Value, "booth") end + if temp_arbitrator.size == 0 + UI.ChangeWidget(Id(:arbitrator_edit), :Enabled, false) + UI.ChangeWidget(Id(:arbitrator_del), :Enabled, false) + else + UI.ChangeWidget(Id(:arbitrator_edit), :Enabled, true) + UI.ChangeWidget(Id(:arbitrator_del), :Enabled, true) + end + if temp_site.size == 0 UI.ChangeWidget(Id(:site_edit), :Enabled, false) UI.ChangeWidget(Id(:site_del), :Enabled, false) @@ -489,6 +484,33 @@ ret = UI.UserInput + if ret == :arbitrator_add + ret = ip_address_input_dialog( + _("Enter an IP address of your arbitrator"), + "" + ) + next if ret == :cancel + temp_arbitrator.push(ret.to_s) + next + end + + if ret == :arbitrator_edit + current = UI.QueryWidget(:arbitrator_box, :CurrentItem).to_i + ret = ip_address_input_dialog( + _("Edit IP address of your arbitrator"), + temp_arbitrator[current] + ) + next if ret == :cancel + temp_arbitrator[current] = ret.to_s + next + end + + if ret == :arbitrator_del + current = UI.QueryWidget(:arbitrator_box, :CurrentItem).to_i + temp_arbitrator.delete_at(current) + next + end + if ret == :site_add ret = ip_address_input_dialog( _("Enter an IP address of your site"), @@ -577,12 +599,6 @@ next end - arbitrator = UI.QueryWidget(:arbitrator, :Value).to_s - if IP.Check(arbitrator) != true - Popup.Message(_("arbitrator IP address is invalid!")) - next - end - port = UI.QueryWidget(:port, :Value).to_s num_port = Builtins.tointeger(port) if num_port == nil || num_port <= 0 || num_port > 65535 @@ -596,6 +612,11 @@ next end + if temp_arbitrator.size == 0 + Popup.Message(_("arbitrator have to be filled!")) + next + end + if temp_site.size == 0 Popup.Message(_("site have to be filled!")) next @@ -608,10 +629,10 @@ GeoCluster.global_files[conf] = {} - GeoCluster.global_files[conf]["arbitrator"] = arbitrator GeoCluster.global_files[conf]["port"] = port GeoCluster.global_files[conf]["transport"] = transport + GeoCluster.global_files[conf]["arbitrator"] = temp_arbitrator GeoCluster.global_files[conf]["site"] = temp_site GeoCluster.global_files[conf]["ticket"] = {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-geo-cluster-3.1.4/src/modules/GeoCluster.rb new/yast2-geo-cluster-3.1.5/src/modules/GeoCluster.rb --- old/yast2-geo-cluster-3.1.4/src/modules/GeoCluster.rb 2014-07-01 04:26:23.000000000 +0200 +++ new/yast2-geo-cluster-3.1.5/src/modules/GeoCluster.rb 2014-07-08 05:31:32.000000000 +0200 @@ -74,8 +74,8 @@ # Read all geo-cluster settings # @return true on success @global_files = {} - @global_conf_single = { "transport" => "UDP", "port" => "9929", "arbitrator" => "" } - @global_conf_list = [ "site" ] + @global_conf_single = { "transport" => "UDP", "port" => "9929" } + @global_conf_list = [ "arbitrator", "site" ] @global_conf_ticket = { "expire" => "", "acquire-after" => "", "timeout" => "", "retries" => "", "weights" => "", "before-acquire-handler" => ""} @global_del_confs = [] end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-geo-cluster-3.1.4/src/servers_non_y2/ag_booth new/yast2-geo-cluster-3.1.5/src/servers_non_y2/ag_booth --- old/yast2-geo-cluster-3.1.4/src/servers_non_y2/ag_booth 2014-07-01 04:26:23.000000000 +0200 +++ new/yast2-geo-cluster-3.1.5/src/servers_non_y2/ag_booth 2014-07-08 05:31:32.000000000 +0200 @@ -55,7 +55,8 @@ # conf_files={"conf_name":{"conf_info"}} conf_files = {} -single_var = ("port", "arbitrator", "transport", "site-user", "site-group", "arbitrator-user", "arbitrator-group") +single_var = ("port", "transport", "site-user", "site-group", "arbitrator-user", "arbitrator-group") +list_var = ("arbitrator", "site") ticket_include = ("ticket", "expire", "acquire-after", "timeout", "retries", "weights", "before-acquire-handler") #ticket_template = { @@ -159,6 +160,7 @@ ret_file = {} site_list = [] + arbitrator_list = [] all_tickets = {} last_ticket = "" @@ -178,23 +180,32 @@ value = tmp[1].strip() var, value = valid_para(var, value) - if var == "site": - site_list.append(value) + if list_var.__contains__(var): + if var == "site": + site_list.append(value) + elif var == "arbitrator": + arbitrator_list.append(value) + elif single_var.__contains__(var): ret_file[var] = value + elif var == "ticket": all_tickets[value] = deepcopy(ticket_template) last_ticket = value + elif ticket_include.__contains__(var): if last_ticket == "": continue all_tickets[last_ticket][var] = value + else: + continue if not ticket_include.__contains__(var): last_ticket = "" # Done reading ret_file["site"] = site_list + ret_file["arbitrator"] = arbitrator_list ret_file["ticket"] = all_tickets return ret_file @@ -234,6 +245,7 @@ # Load file info into memory,like: # {'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': ''}, @@ -288,7 +300,7 @@ if conf_files[path[0]].get(path[1]) is None: return "nil" return '"%s"' % conf_files[path[0]].get(path[1]) - elif path[1] == "site": + elif list_var.__contains__(path[1]): return generate_list_string(conf_files[path[0]].get(path[1], [])) else: return "nil" @@ -336,8 +348,8 @@ if single_var.__contains__(path[1]): conf_files[path[0]][path[1]] = args return "true" - # "site" need a string(args) of list, split by ; - elif path[1] == "site": + # List string like "site" or "arbitrator" need a string(args) of list, split by ; + elif list_var.__contains__(path[1]): conf_files[path[0]][path[1]] = convert_string_to_list(args) return "true" else: @@ -397,8 +409,8 @@ #fd.write("#%s\n" % (docs.get(i, ""))) fd.write("%s = %s\n" % (i, c_struct[i])) - # List var, like site - for i in ["site"]: + # List var, like arbitrator or site + for i in list_var: if c_struct.__contains__(i): for line in c_struct[i]: #fd.write("#%s\n" % (docs.get(i, ""))) -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org