1
0
Fork 0
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:
Chirag Jog 2013-03-08 21:31:31 +05:30
parent 8c56814d50
commit 269e4e7eba

View file

@ -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