M #-: fix minor bug in cluster FSCK (#1631)

This commit is contained in:
Alejandro Huertas Herrero authored and GitHub committed 2021-11-30 10:42:49 +01:00
1 parent 014447a3d6
commit ad1a5cbc16
1 file changed
+6 -2
+6 -2
View File
@@ -169,7 +169,9 @@ module OneDBFsck
:cluster_datastore_relation_new)
@db.fetch('SELECT * from cluster_datastore_relation') do |row|
if cluster[row[:cid]][:datastores].count(row[:oid]) != 1
if !cluster[row[:cid]] || cluster[row[:cid]][:datastores].count(
row[:oid]
) != 1
log_error('Table cluster_datastore_relation contains ' \
"relation cluster #{row[:cid]}, datastore " \
"#{row[:oid]}, but it should not")
@@ -190,7 +192,9 @@ module OneDBFsck
:cluster_network_relation_new)
@db.fetch('SELECT * from cluster_network_relation') do |row|
if cluster[row[:cid]][:vnets].count(row[:oid]) != 1
if !cluster[row[:cid]] || cluster[row[:cid]][:vnets].count(
row[:oid]
) != 1
log_error('Table cluster_network_relation contains ' \
"relation cluster #{row[:cid]}, " \
"vnet #{row[:oid]}, but it should not")