Bug 1181727
| Summary: | Including a space in first line of user-data seems to cause cloud-init to not fully run | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Matt Reid <mreid> |
| Component: | cloud-init | Assignee: | Lars Kellogg-Stedman <lars> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-01-19 17:10:57 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Matt Reid
2015-01-13 16:42:02 UTC
Cloud-init uses the first line of a file to identify the file type, much like the standard '#!' semantics for scripts under Unix. For example, the following script would fail to execute properly:
#!/usr/bin/python
from sys import stdout
stdout.write('Hello world\n')
If you were to drop that into a file and make it executable, the '#!' line would be ignore because of the space, the system would attempt to execute it with /bin/sh instead, and you would get:
./foo: line 2: from: command not found
./foo: line 3: syntax error near unexpected token `'Hello world\n''
./foo: line 3: `stdout.write('Hello world\n')'
I think that the failure you see from cloud-init is similar in nature and is the appropriate behavior.
The formats accepted by cloud-init are documented upstream in https://cloudinit.readthedocs.org/en/latest/topics/format.html. I'm glad you were able to have our local documentation corrected.
|