Skip to content

feat: add cloud_init_config and snap-safe temp file handling - #7

Open
miciav wants to merge 13 commits into
okyanusoz:mainfrom
miciav:feat/cloud-init-config
Open

feat: add cloud_init_config and snap-safe temp file handling#7
miciav wants to merge 13 commits into
okyanusoz:mainfrom
miciav:feat/cloud-init-config

Conversation

@miciav

@miciav miciav commented Apr 6, 2026

Copy link
Copy Markdown

Summary

  • Adds cloud_init_config parameter to launch(), accepting a dict (serialized to JSON) or a raw YAML string
  • Temp files are written to Path.home() instead of /tmp so Multipass installed via snap can access them
  • Temp file is deleted automatically (try/finally) after launch completes
  • Backward compatible: existing cloud_init file path parameter unchanged

Test plan

  • test_launch_with_cloud_init_config_dict — verifies dict content written correctly and temp file cleaned up
  • test_launch_with_cloud_init_config_str — verifies YAML string written as-is and temp file cleaned up
  • All 19 unit tests pass

🤖 Generated with Claude Code

miciav and others added 13 commits April 5, 2026 17:09
- Fix SnapshotInfo.from_snapshots_json to match actual Multipass CLI format
  (nested dict info.{instance}.{snap_name} instead of flat list)
- Fix cpu_count parsing to handle empty string on stopped VMs
- Update integration tests disk size 3G→5G (Ubuntu 22.04 minimum)
- Add 8 new integration test scenarios: resources, suspend/resume,
  file transfer, snapshot/restore, clone, cloud-init, error handling
- Update unit test fixtures to use correct snapshot JSON format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds cloud_init_config to launch() accepting a dict (serialized to JSON)
or a raw YAML string. Temp files are written to Path.home() instead of
/tmp so Multipass installed via snap can access them. File is deleted
automatically after launch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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