File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
app/models/manageiq/providers/vmware/infra_manager
spec/models/manageiq/providers/vmware Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ def raw_connect(options)
7979 }
8080 )
8181
82- raise MiqException ::Error , _ ( "Adding ESX/ESXi Hosts is not supported" ) unless vim . isVirtualCenter
82+ raise MiqException ::Error , _ ( "Adding ESX/ESXi Hosts is not supported" ) if ! vim . isVirtualCenter && ! Settings . prototype . ems_vmware . allow_direct_hosts
8383 raise MiqException ::Error , _ ( "vCenter version %{version} is unsupported" ) % { :version => vim . apiVersion } if !version_supported? ( vim . apiVersion )
8484
8585 # If the time on the vCenter is very far off from MIQ system time then
Original file line number Diff line number Diff line change 6060 :ems_refresh_worker_vmware_cloud : {}
6161 :ems_refresh_worker_vmware_cloud_network : {}
6262 :ems_refresh_worker_vmware_tanzu : {}
63+ :prototype :
64+ :ems_vmware :
65+ :allow_direct_hosts : false
Original file line number Diff line number Diff line change 7171 expect { described_class . verify_credentials ( verify_params ) }
7272 . to raise_error ( MiqException ::Error , "Adding ESX/ESXi Hosts is not supported" )
7373 end
74+
75+ context "with allow_direct_hosts setting set to true" do
76+ before { stub_settings_merge ( :prototype => { :ems_vmware => { :allow_direct_hosts => true } } ) }
77+
78+ it "is successful" do
79+ expect ( described_class . verify_credentials ( verify_params ) ) . to be_truthy
80+ end
81+ end
7482 end
7583
7684 context "vCenter currentTime out of sync" do
You can’t perform that action at this time.
0 commit comments