summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index fc4233de..8f6a6b0d 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -389,3 +389,9 @@ def shellify(cmdlist):
else:
content="%s%s\n" % ( content, str(args) )
return content
+
+def dos2unix(input):
+ # find first end of line
+ pos = input.find('\n')
+ if pos <= 0 or input[pos-1] != '\r': return(input)
+ return(input.replace('\r\n','\n'))