From 97f48ed19230c99ac1e64900462766430b6e31dd Mon Sep 17 00:00:00 2001 From: cwei44 Date: Wed, 23 Mar 2022 17:22:02 -0700 Subject: [PATCH] Update rvc-util.rb --- rvc_rvc/lib/rvc/modules/vsantest/automation/lib/rvc-util.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rvc_rvc/lib/rvc/modules/vsantest/automation/lib/rvc-util.rb b/rvc_rvc/lib/rvc/modules/vsantest/automation/lib/rvc-util.rb index 0d9af36..0257207 100755 --- a/rvc_rvc/lib/rvc/modules/vsantest/automation/lib/rvc-util.rb +++ b/rvc_rvc/lib/rvc/modules/vsantest/automation/lib/rvc-util.rb @@ -644,7 +644,10 @@ def _get_vsan_stats(datastore_name) datastore_full_moid = _get_moid("ds",datastore_name).join(":") vsan_info_json = JSON.parse(`govc datastore.vsan.info -json -dc "#{Shellwords.escape($dc_name)}" -m #{datastore_full_moid}`.chomp) vsan_default_policy_id = vsan_info_json["DatastoreDefaultProfileId"][datastore_full_moid][0] - vsan_detail = JSON.parse(vsan_info_json["DatastoreDefaultProfileId"][datastore_full_moid][1]) + vsan_detail = {} + if vsan_info_json["DatastoreDefaultProfileId"][datastore_full_moid][1] != "" + vsan_detail = JSON.parse(vsan_info_json["DatastoreDefaultProfileId"][datastore_full_moid][1]) + end vsan_cluster_name = vsan_info_json["DatastoreDefaultProfileId"][datastore_full_moid][2] return vsan_default_policy_id, vsan_detail, vsan_cluster_name end