canonical / canonical/cloud-init

Should be wrapped in try...except in case of JSONDecodeError

Open Beginner friendly
#7,069 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

https://github.com/canonical/cloud-init/blob/3082dcb2a31491a4f7630dee75046316f046df3c/cloudinit/stages.py#L450-L452

Wrap util.load_json(...) in a try...except (json.decoder.JSONDecodeError, ValueError): block so that corrupt or empty cache files are safely ignored and regenerated.

Contributor guide

Open the contributing guide

Research direction

Start at cloudinit/stages.py lines 450-452 and inspect the util.load_json(...) call. Handle JSONDecodeError and ValueError so corrupt or empty cache files are ignored and regenerated, then verify that behavior for both cache-file cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.