ingrammicro / cio

IMCO agent and CLI tool
Apache License 2.0
2 stars 0 forks source link

Attachment dir environment variable has wrong value on Windows #93

Closed pbanos closed 2 years ago

pbanos commented 2 years ago

Expected Behavior

The environment variable ATTACHMENT_DIR should be a path using the character \ as directory separator on Windows

Current Behavior

The environment variable ATTACHMENT_DIR is a path that uses both the characters / and \ as directory separators on Windows

Possible Solution

Use filepath.Join in line 106 of dispatcher/script.go

Steps to Reproduce (for bugs)

  1. Create a script with the code echo %ATTACHMENT_DIR% and add it to a Windows template as a boot script
  2. Deploy a server with that Windows template
  3. When the server gets operational, it should have an script execution event with an output similar to C:\Windows\TEMP\cio2413023516/attachments, the / should be a \

Context and environment

pcantera commented 2 years ago

Done PR #95