summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Holman <brett.holman@canonical.com>2022-11-10 14:41:01 -0700
committerGitHub <noreply@github.com>2022-11-10 15:41:01 -0600
commit4dfb6845f4f2201b3f53720fad1fa351a9270388 (patch)
treef67c969659aafa88a12cbf9a70d35a2260327152
parent60e2b2845b7a28a3bfecf42901380faedcfc751c (diff)
downloadcloud-init-git-4dfb6845f4f2201b3f53720fad1fa351a9270388.tar.gz
ci: run json tool on 22.04 rather than 20.04 (#1823)
-rw-r--r--.github/workflows/check_format.yml5
-rw-r--r--cloudinit/config/schemas/schema-cloud-config-v1.json7
-rwxr-xr-xtools/check_json_format.sh9
3 files changed, 10 insertions, 11 deletions
diff --git a/.github/workflows/check_format.yml b/.github/workflows/check_format.yml
index bf9c6f0b..4e7a7271 100644
--- a/.github/workflows/check_format.yml
+++ b/.github/workflows/check_format.yml
@@ -52,11 +52,8 @@ jobs:
schema-format:
strategy:
fail-fast: false
- matrix:
- lint-with:
- - {tip-versions: true, os: ubuntu-latest}
name: Check json format
- runs-on: ${{ matrix.lint-with.os }}
+ runs-on: ubuntu-22.04
steps:
- name: "Checkout #1"
uses: actions/checkout@v3.0.0
diff --git a/cloudinit/config/schemas/schema-cloud-config-v1.json b/cloudinit/config/schemas/schema-cloud-config-v1.json
index 3cb0d848..d504f07a 100644
--- a/cloudinit/config/schemas/schema-cloud-config-v1.json
+++ b/cloudinit/config/schemas/schema-cloud-config-v1.json
@@ -460,7 +460,7 @@
"run-user": {
"type": "string",
"description": "User to run module commands as. If install-method: pip, the pip install runs as this user as well."
- },
+ },
"ansible_config": {
"description": "Sets the ANSIBLE_CONFIG environment variable. If set, overrides default config.",
"type": "string"
@@ -472,7 +472,10 @@
"repositories": {
"type": "array",
"items": {
- "required": ["path", "source"],
+ "required": [
+ "path",
+ "source"
+ ],
"type": "object",
"additionalProperties": false,
"properties": {
diff --git a/tools/check_json_format.sh b/tools/check_json_format.sh
index ac73dc42..62f7d6cd 100755
--- a/tools/check_json_format.sh
+++ b/tools/check_json_format.sh
@@ -5,8 +5,7 @@
# requires python 3.9 for --indent
#
file=$1
-before=$(cat "$file")
-python3 -m json.tool --indent 2 "$file" "$file"
-after=$(cat "$file")
-test "$before" = "$after"
-exit $?
+before=$(cat "$file") &&
+ python3 -m json.tool --indent 2 "$file" "$file" &&
+ after=$(cat "$file") &&
+ test "$before" = "$after"