Skip to content

Commit

Permalink
Parse if a datastore is accessible from a host
Browse files Browse the repository at this point in the history
Parse if a datastore is able to be accessed from a host into the
host_storage record.

https://bugzilla.redhat.com/show_bug.cgi?id=1668020
  • Loading branch information
agrare committed Jan 23, 2019
1 parent 550f1c4 commit 22930e3
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,15 @@ def self.host_inv_to_host_storages_hashes(inv, storage_inv, storage_uids)
host_mount = Array.wrap(s_inv["host"]).detect { |host| host["key"] == inv["MOR"] }
next if host_mount.nil?

read_only = host_mount.fetch_path("mountInfo", "accessMode") == "readOnly"
mount_info = host_mount["mountInfo"] || {}
read_only = mount_info["accessMode"] == "readOnly"
accessible = mount_info["accessible"].present? ? mount_info["accessible"] : true

result << {
:storage => storage_uids[s_mor],
:read_only => read_only,
:ems_ref => s_mor
:storage => storage_uids[s_mor],
:read_only => read_only,
:accessible => accessible,
:ems_ref => s_mor
}
end

Expand Down

0 comments on commit 22930e3

Please sign in to comment.