From c6456c6407805b1a8000d8166e981d861430fa2a Mon Sep 17 00:00:00 2001 From: Radoslav Gerganov Date: Mon, 18 Jun 2018 15:03:10 +0300 Subject: [PATCH] Add traversal spec for datastoreFolder StoragePods (a.k.a datastore clusters) are located under Datacenter.datastoreFolder, so we need a new traversal spec in order to retrieve them. Change-Id: I899f8f6ef05a94d21d13a55ca0a0f8fbd042a448 --- oslo_vmware/tests/test_vim_util.py | 4 ++++ oslo_vmware/vim_util.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/oslo_vmware/tests/test_vim_util.py b/oslo_vmware/tests/test_vim_util.py index c5c20fea..27fecaea 100644 --- a/oslo_vmware/tests/test_vim_util.py +++ b/oslo_vmware/tests/test_vim_util.py @@ -81,6 +81,10 @@ class VimUtilTest(base.TestCase): 'path': 'networkFolder', 'skip': False, 'selectSet': [sel_spec]}, + 'dc_to_df': {'type': 'Datacenter', + 'path': 'datastoreFolder', + 'skip': False, + 'selectSet': [sel_spec]}, 'h_to_vm': {'type': 'HostSystem', 'path': 'vm', 'skip': False, diff --git a/oslo_vmware/vim_util.py b/oslo_vmware/vim_util.py index bba2f29a..4105cda5 100644 --- a/oslo_vmware/vim_util.py +++ b/oslo_vmware/vim_util.py @@ -97,6 +97,12 @@ def build_recursive_traversal_spec(client_factory): 'networkFolder', False, [visit_folders_select_spec]) + dc_to_df = build_traversal_spec(client_factory, + 'dc_to_df', + 'Datacenter', + 'datastoreFolder', + False, + [visit_folders_select_spec]) # Next hop from HostSystem h_to_vm = build_traversal_spec(client_factory, @@ -179,6 +185,7 @@ def build_recursive_traversal_spec(client_factory): dc_to_hf, dc_to_vmf, dc_to_netf, + dc_to_df, cr_to_ds, cr_to_h, cr_to_rp,