1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

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

(cherry picked from commit ad1a5cbc1657d42dba81196b4b2eaaa4b8fa9d7c)
This commit is contained in:
Alejandro Huertas Herrero 2021-11-30 10:42:49 +01:00 committed by Tino Vazquez
parent 294362d96f
commit 3481115e15
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

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")