Skip to content

Commit

Permalink
Remove unused codes
Browse files Browse the repository at this point in the history
- Remove 'Cluster.config_format'
- Remove 'memberaddr'
  • Loading branch information
liangxin1300 committed Jul 6, 2023
1 parent 78925c0 commit 2d1a537
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
9 changes: 0 additions & 9 deletions src/include/cluster/dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -998,15 +998,6 @@ def CommunicationLayout

UI.ChangeWidget(Id(:linkmode), :Value, Cluster.link_mode)

# BNC#879596, check the corosync.conf format
if Cluster.config_format == "corosync2"
Popup.Message(_(" NOTICE: Detected old corosync2 configuration.\n Please reconfigure the node/interface list and confirm all other settings."))
Cluster.config_format = "showed"
elsif Cluster.config_format == "openais"
Popup.Message(_(" NOTICE: Detected old(SLE11) openais/corosync configuration.\n Please reconfigure the node list and confirm all other settings."))
Cluster.config_format = "showed"
end

nil
end

Expand Down
5 changes: 0 additions & 5 deletions src/modules/Cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ def main
@expected_votes = ""
@two_node = "0"

@config_format = ""

@corokey = ""
@csync2key = ""
@global_startcorosync = false
Expand Down Expand Up @@ -227,8 +225,6 @@ def LoadClusterConfig

@expected_votes = SCR.Read(path(".corosync.quorum.expected_votes")).to_s

@config_format = SCR.Read(path(".corosync.totem.interface.member.memberaddr")).to_s

@transport = SCR.Read(path(".corosync.totem.transport"))
@transport = "knet" if @transport == nil

Expand Down Expand Up @@ -833,7 +829,6 @@ def AutoPackages
publish :variable => :heuristics_interval, :type => "string"
publish :variable => :heuristics_executables, :type => "map <string, string>"
publish :variable => :two_node, :type => "string"
publish :variable => :config_format, :type => "string"
publish :variable => :corokey, :type => "string"
publish :variable => :csync2key, :type => "string"
publish :variable => :global_startcorosync, :type => "boolean"
Expand Down
33 changes: 3 additions & 30 deletions src/servers_non_y2/ag_corosync
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,6 @@ node_option_table = {
},
}

# BNC-879596. Obsolete, just use to detect the file format is SLE11SP3 or SLE12
old_memberlist_table = {
"memberaddr": {
"doc": "obsolete! Only use to detect old(SLE11SP3) format.",
"type": "string",
"default_value": "0",
},
}

logging_option_table = {
"debug": {
Expand Down Expand Up @@ -941,11 +933,6 @@ def opt_parser(file, options, parent):
result["heuristics"] = opt_parser(
file, quorum_qdevice_heuristics_option_table, "heuristics"
)
# member of interface is removed in the latest version
elif i.lstrip().split(" ")[0] == "member" and parent == "interface":
oldmembers = result.get("oldlist", [])
oldmembers.append(opt_parser(file, old_memberlist_table, "oldlist"))
result["oldlist"] = oldmembers
else:
# y2warning("Unknown sub-directive %s found. Ignore it" % (i.lstrip().split(" ")[0]))
while i[-1] != "}":
Expand Down Expand Up @@ -1020,18 +1007,7 @@ def generateMemberString(node):
return '"%s"' % member_str.strip()


# obsolete setting. BNC-879596, pop up a message if config file is in old format.
def check_conf_format():
if "rrp_mode" in totem_options:
return "corosync2"

for x in range(len(totem_options["interface"])):
if "oldlist" in totem_options["interface"][x]:
return "corosync"
return "latest"


def load_ais_conf(filename):
def load_corosync_conf(filename):
try:
f = open(filename, "r")
file_parser(f)
Expand Down Expand Up @@ -1071,7 +1047,7 @@ def _return_str_list(obj):

class CorosyncConf_Parser(object):
def __init__(self):
load_ais_conf("/etc/corosync/corosync.conf")
load_corosync_conf("/etc/corosync/corosync.conf")

def doList(self, path_arr):
if len(path_arr) == 0:
Expand Down Expand Up @@ -1232,10 +1208,7 @@ class CorosyncConf_Parser(object):
return "nil"
elif len(path) == 4:
if path[1] == "interface":
# bsc#879596, "member" only exist in old format.
if path[2] == "member":
return '"%s"' % check_conf_format()
elif path[2].isdigit():
if path[2].isdigit():
if len(totem_options["interface"]) > int(path[2]):
i = totem_options["interface"][int(path[2])]

Expand Down

0 comments on commit 2d1a537

Please sign in to comment.