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)

This commit is contained in:
Alejandro Huertas Herrero 2021-11-30 10:42:49 +01:00 committed by GitHub
parent 014447a3d6
commit ad1a5cbc16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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