Comment 4 for bug 1595863

Revision history for this message
Jose Phillips (jose-phillips) wrote :

Hi
log.txt and powershell.log are not populated cuz the agent can't execute

this is happening because Cloudbase-init can't parse the windows-init.ps1 in cloudbase-init logs i got this error.

 WARNING cloudbaseinit.plugins.common.userdatautils [-] Unsupported user_data format

Checking the code of cloudbase-init on user

# Avoid 80+ length by using a local variable, which
# is deleted afterwards.
_compile = functools.partial(re.compile, flags=re.I)
FORMATS = (
    (_compile(br'^rem\s+cmd\s'), execcmd.Shell),
    (_compile(br'^#!\s*/usr/bin/env\s+python\s'), execcmd.Python),
    (_compile(br'^#!'), execcmd.Bash),
    (_compile(br'^#(ps1|ps1_sysnative)\s'), execcmd.PowershellSysnative),
    (_compile(br'^#ps1_x86\s'), execcmd.Powershell),
    (_compile(br'</?(script|powershell)>'), execcmd.EC2Config),

)

for me made me sense put the interpreter #ps1 at the beginning of the file instead after the licensing information.