canonical / canonical/cloud-init

schema: wrong validation of cc_users_groups

Open
#3,991 1 comment 0 reactions 0 assignees View on GitHub
bug launchpad
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

This bug was originally filed in Launchpad as [LP: #1979491](https://bugs.launchpad.net/cloud-init/+bug/1979491)

Launchpad details

affected_projects = []

assignee = None
assignee_name = None
date_closed = None
date_created = 2022-06-22T09:54:20.224282+00:00
date_fix_committed = None
date_fix_released = None
id = 1979491
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1979491
milestone = None
owner = aciba
owner_name = Alberto Contreras
private = False
status = triaged
submitter = aciba
submitter_name = Alberto Contreras
tags = []
duplicates = []

_Launchpad user **Alberto Contreras(aciba)** wrote on 2022-06-22T09:54:20.224282+00:00_

The schema validation does detect the following wrong schema as valid:

```yaml
#cloud-config
groups:
- 3.14
```

Steps to reproduce:

```sh
cat < /tmp/user-data
#cloud-config
groups:
- 3.14
EOF

lxc launch ubuntu-daily:jammy gg --config=user.user-data="$(cat /tmp/user-data)"
$ lxc exec gg -- cloud-init status --wait
..............
status: error

$ lxc exec gg -- grep -ni "error" /var/log/cloud-init.log
412: raise TypeError(
413:TypeError: Unknown group name type float
440: raise TypeError(
441:TypeError: Unknown group name type float

$ lxc exec gg -- cloud-init schema --system
Valid cloud-config: system userdata

$ lxc exec gg -- echo $?
0
```

The schema validation should detect this schema as invalid.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.