1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Finally i got it fixed!!!

This commit is contained in:
Rodrigo Estebanez 2013-07-04 20:36:08 +02:00
parent c6a6786de8
commit 2c85af5c83
2 changed files with 9 additions and 4 deletions

View file

@ -71,8 +71,13 @@ module Fog
# the order maters http://communities.vmware.com/thread/448760?start=0&tstart=0
# http://www.vmware.com/support/vcd/doc/rest-api-doc-1.5-html/types/GuestCustomizationSectionType.html
# CustomizationScript
# Script to run on guest customization. You could use xml escape sequence &#13; to make multiple lines script. The script could contain any UNICODE symbol by specifying its number in format &#xxxx; where xxxx is the number. The predefined symbols in the XML are: * & &amp; * < &lt; * > &gt; * " &quot; * ' &apos;
def body(opts={})
body = <<EOF
body = "
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<Enabled>#{opts[:enabled]}</Enabled>
<ChangeSid>#{opts[:change_sid]}</ChangeSid>
@ -82,9 +87,8 @@ module Fog
<AdminPasswordEnabled>#{opts[:admin_password_enabled]}</AdminPasswordEnabled>
<AdminPasswordAuto>#{opts[:admin_password_auto]}</AdminPasswordAuto>
<ResetPasswordRequired>#{opts[:reset_password_required]}</ResetPasswordRequired>
<CustomizationScript>#{CGI.escapeHTML(opts[:customization_script])}</CustomizationScript>
<ComputerName>#{opts[:computer_name]}</ComputerName>
EOF
<CustomizationScript>#{CGI::escapeHTML(opts[:customization_script]).gsub(/\r/, "&#13;")}</CustomizationScript>
<ComputerName>#{opts[:computer_name]}</ComputerName>"
end
def tail

View file

@ -21,6 +21,7 @@ module Fog
attribute :computer_name
attribute :has_customization_script
# bug: for some reason if the customization_script has /r, is showed here as /n. Looks likes is something in excon
def script
attributes[:customization_script]
end