F #~: fix root template (#1047)

Signed-off-by: Carlos Herrera <cherrera@opennebula.io>
This commit is contained in:
Carlos J. Herrera authored and GitHub committed 2021-03-30 17:28:08 +02:00
1 parent 54d40162ce
commit 0de1ef3780
1 file changed
+7 -5
@@ -1659,10 +1659,12 @@ module VCenterDriver
folders = []
until item.instance_of? RbVmomi::VIM::Datacenter
item = item.parent
first_condition = item.instance_of? RbVmomi::VIM::Datacenter
second_condition = item.name != 'vm'
first_condition =
!(item.instance_of? RbVmomi::VIM::Datacenter)
second_condition =
item.name != 'vm'
unless first_condition && second_condition
if first_condition && second_condition
folders << item.name
end
if item.nil?
@@ -1693,8 +1695,8 @@ module VCenterDriver
one_tmp[:dc_name] = dc_name
one_tmp[:template_name] = template_name
one_tmp[:sunstone_template_name]=
"#{template_name} [ Cluster: #{template_ccr_name} \
- Template location: #{location} ]"
"#{template_name} [ Cluster: #{template_ccr_name}" \
"- Template location: #{location} ]"
one_tmp[:template_location] = location
one_tmp[:vcenter_ccr_ref] = template_ccr_ref
one_tmp[:vcenter_ref] = template_ref