def _get_ds_browser(self, ds_ref): ds_browser = self._ds_browser.get(ds_ref.value) if not ds_browser: ds_browser = vim_util.get_dynamic_property(self._session.vim, ds_ref, "Datastore", "browser") self._ds_browser[ds_ref.value] = ds_browser return ds_browser
def _get_ds_browser(self, ds_ref): ds_browser = self._ds_browser.get(ds_ref.value) if not ds_browser: ds_browser = vim_util.get_dynamic_property( self._session.vim, ds_ref, "Datastore", "browser") self._ds_browser[ds_ref.value] = ds_browser return ds_browser
def test_get_dynamic_properties_missing_path_exists(self): self.useFixture( fixtures.MonkeyPatch( 'patron.virt.vmwareapi.vim_util.get_object_properties', _fake_get_object_properties_missing)) res = vim_util.get_dynamic_property('fake-vim', 'fake-obj', 'fake-type', 'fake-property') self.assertIsNone(res)