← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1983306] [NEW] schema validation not in line with specification

 

Public bug reported:

Related to #1983303. My user-data begins with #include, as it's not a
"Cloud Config Data" but an "Include File" as described in the official
documentation. However, this causes the validator `cloud-init schema
--system` to complain that

```
Error:
Cloud config schema errors: format-l1.c1: File None needs to begin with "#cloud-config"
```

Ok I thought, I just manually add "#cloud-config" at the top and re-
test:

```
Error:
Cloud-config is not a YAML dict.
```

Well, it's not a YAML dict because it's not a cloud config data but an
include file, which isn't in the YAML format.

See the specification:
https://cloudinit.readthedocs.io/en/latest/topics/format.html

Also look at the implementation in `user_data.py`, function
`_do_include`. As you can see, this file isn't processed as YAML but
parsed line by line. So the specification and implementation agree, but
the schema validator doesn't and thinks it should process it as YAML.

This wouldn't be a practical problem for me, but due to #19833303 I get
mangled logs and can't work around it.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1983306

Title:
  schema validation not in line with specification

Status in cloud-init:
  New

Bug description:
  Related to #1983303. My user-data begins with #include, as it's not a
  "Cloud Config Data" but an "Include File" as described in the official
  documentation. However, this causes the validator `cloud-init schema
  --system` to complain that

  ```
  Error:
  Cloud config schema errors: format-l1.c1: File None needs to begin with "#cloud-config"
  ```

  Ok I thought, I just manually add "#cloud-config" at the top and re-
  test:

  ```
  Error:
  Cloud-config is not a YAML dict.
  ```

  Well, it's not a YAML dict because it's not a cloud config data but an
  include file, which isn't in the YAML format.

  See the specification:
  https://cloudinit.readthedocs.io/en/latest/topics/format.html

  Also look at the implementation in `user_data.py`, function
  `_do_include`. As you can see, this file isn't processed as YAML but
  parsed line by line. So the specification and implementation agree,
  but the schema validator doesn't and thinks it should process it as
  YAML.

  This wouldn't be a practical problem for me, but due to #19833303 I
  get mangled logs and can't work around it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1983306/+subscriptions



Follow ups