fix removal of '#cloud-boothook' inside a boothook

The goal was to remove '#cloud-boothook' from a part if the part
started that way.  This was to allow user data of
  #cloud-boothook
  #!/usr/bin/perl
  ...

to be handled correctly.  That had 2 bugs
1.) the prefix string was wrong
2.) was checking for '\r' in the wrong location
This commit is contained in:
Scott Moser 2010-07-01 20:48:40 -04:00
parent 4aecbf3908
commit 1c312e842c

View File

@ -421,11 +421,11 @@ class CloudInit:
if ctype == "__begin__": return
filename=filename.replace(os.sep,'_')
prefix="#cloud-boothooks"
prefix="#cloud-boothook"
dos=False
start = 0
if payload.startswith(prefix):
start = len(prefix)+1
start = len(prefix)
if payload[start] == '\r':
start=start+1
dos = True