Class: Fog::Vcloud::Compute::CatalogItem

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vcloud/models/compute/catalog_item.rb

Instance Attribute Summary

Attributes inherited from Model

#loaded

Instance Method Summary collapse

Methods inherited from Model

has_up, #link_up, #load_unless_loaded!, #reload

Instance Method Details

#customization_optionsObject



15
16
17
18
19
20
21
22
23
# File 'lib/fog/vcloud/models/compute/catalog_item.rb', line 15

def customization_options
  load_unless_loaded!
  if data = service.get_customization_options( link[:href] ).body
    data.delete_if { |key, value| [:xmlns_i, :xmlns].include?(key) }
    data
  else
    nil
  end
end

#password_enabled?Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
31
32
# File 'lib/fog/vcloud/models/compute/catalog_item.rb', line 25

def password_enabled?
  load_unless_loaded!
  customization_options = service.get_vapp_template(self.entity[:href]).body[:Children][:Vm][:GuestCustomizationSection]
  return false if customization_options[:AdminPasswordEnabled] == "false"
  return true if customization_options[:AdminPasswordEnabled] == "true" \
    and customization_options[:AdminPasswordAuto] == "false" \
    and ( options[:password].nil? or options[:password].empty? )
end