mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Check if a template requires a password or not
This commit is contained in:
parent
8c56814d50
commit
269e4e7eba
1 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,14 @@ module Fog
|
|||
end
|
||||
end
|
||||
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue