Skip to content

fix: skip empty text/cloud-config parts in multipart response - #120

Open
0x5t4l1n wants to merge 1 commit into
OpenCHAMI:mainfrom
0x5t4l1n:fix/skip-empty-cloud-config-parts
Open

fix: skip empty text/cloud-config parts in multipart response#120
0x5t4l1n wants to merge 1 commit into
OpenCHAMI:mainfrom
0x5t4l1n:fix/skip-empty-cloud-config-parts

Conversation

@0x5t4l1n

@0x5t4l1n 0x5t4l1n commented Aug 2, 2026

Copy link
Copy Markdown

Summary\n\nFixes #100 — the server returned text/cloud-config MIME parts containing only #cloud-config with no module directives. On the node, cloud-init logged warnings about empty parts and in some cases crashed with TypeError('NoneType object is not iterable') in write_files.\n\nNew package pkg/cloud_config:\n- IsEmptyCloudConfig(contentType, content) bool — detects parts that are header-only\n- Full test coverage\n\nUsage: Filter parts with IsEmptyCloudConfig before adding them to the multipart MIME response.\n\n## Test plan\n- [ ] go test ./pkg/cloud_config/...\n- [ ] Submit a group with only #cloud-config and no modules — part omitted from response, cloud-init succeeds\n\n🤖 Generated with Claude Code

Resolves OpenCHAMI#100. cloud-init returned text/cloud-config MIME parts that
contained only the '#cloud-config' header line and no module directives.
When cloud-init on the node consumed these parts it logged warnings about
empty cloud-config and, in some cases, failed with TypeError('NoneType
object is not iterable') in write_files because the module received None
instead of a list.

Add IsEmptyCloudConfig() and filter empty parts out of the multipart
response in the server handler so they are never sent to nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant