From 544d155fbbf438e59fe88089bc9e46ebb8113bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 21 Apr 2014 11:56:16 +0200 Subject: [PATCH] Bug #2839: Fsck now allows multiple system DS in the same cluster --- src/onedb/fsck.rb | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/src/onedb/fsck.rb b/src/onedb/fsck.rb index 60cc33f40a..aa17b35437 100644 --- a/src/onedb/fsck.rb +++ b/src/onedb/fsck.rb @@ -326,8 +326,6 @@ module OneDBFsck cluster[row[:oid]][:hosts] = [] cluster[row[:oid]][:datastores] = [] cluster[row[:oid]][:vnets] = [] - - cluster[row[:oid]][:system_ds] = 0 end hosts_fix = {} @@ -410,28 +408,7 @@ module OneDBFsck datastores_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} else - if doc.root.get_text('TYPE').to_s != "1" - cluster_entry[:datastores] << row[:oid] - else - if cluster_entry[:system_ds] == 0 - cluster_entry[:datastores] << row[:oid] - cluster_entry[:system_ds] = row[:oid] - else - log_error("System Datastore #{row[:oid]} is in Cluster #{cluster_id}, but it already contains System Datastore #{cluster_entry[:system_ds]}") - - doc.root.each_element('CLUSTER_ID') do |e| - e.text = "-1" - end - - doc.root.each_element('CLUSTER') do |e| - e.text = "" - end - - datastores_fix[row[:oid]] = {:body => doc.to_s, :cid => -1} - - next - end - end + cluster_entry[:datastores] << row[:oid] if cluster_name != cluster_entry[:name] log_error("Datastore #{row[:oid]} has a wrong name for cluster #{cluster_id}, #{cluster_name}. It will be changed to #{cluster_entry[:name]}") @@ -533,16 +510,6 @@ module OneDBFsck ds_new_elem = doc.root.add_element("DATASTORES") - doc.root.each_element("SYSTEM_DS") do |e| - system_ds = e.text.to_i - - if system_ds != cluster[cluster_id][:system_ds] - log_error("Cluster #{cluster_id} has System Datastore set to #{system_ds}, but it should be #{cluster[cluster_id][:system_ds]}") - - e.text = cluster[cluster_id][:system_ds].to_s - end - end - cluster[cluster_id][:datastores].each do |id| id_elem = ds_elem.elements.delete("ID[.=#{id}]")