diff --git a/api-doc/build.py b/api-doc/build.py index 7719a9d3d8c..50b886a0d3e 100755 --- a/api-doc/build.py +++ b/api-doc/build.py @@ -25,6 +25,13 @@ for template in templates: with open(template, 'r') as content_file: main = yaml.load(content_file.read(), Loader=yaml.FullLoader) + + ################################################################################ + # Lint doc using redocly (on split files to allow correct file reports) + if subprocess.call(['npx', 'redocly', 'lint', template]): + print('Linter failed on %s' % (template)) + exit(1) + version = main['info']['version'] intro_file = main['info']['description'] @@ -40,18 +47,12 @@ # Dump target in target .yml file src_openapi_file = template.replace('.src', '') with open(src_openapi_file, 'w') as file: - documents = yaml.dump(main, file) + yaml.dump(main, file) target = '%s/%s/%s' % (target_dir, api, version) print('Built %s' % (src_openapi_file)) - ################################################################################ - # Lint doc using redocly (on split files to allow correct file reports) - if subprocess.call(['npx', 'redocly', 'lint', src_openapi_file]): - print('Linter failed on %s' % (src_openapi_file)) - exit(1) - ################################################################################ # Build final OpenAPI spec files using redocly for format in ["yml", "json"]: diff --git a/api-doc/redocly.yml b/api-doc/redocly.yml index 03462d46938..c75a0593575 100644 --- a/api-doc/redocly.yml +++ b/api-doc/redocly.yml @@ -17,7 +17,7 @@ rules: no-invalid-media-type-examples: severity: 'error' allowAdditionalProperties: false - no-server-example.com: 'error' + no-server-example.com: 'warn' # we should migrate away from localhost as server url no-unused-components: 'error' theme: diff --git a/policies/module-types/system-updates/src/package_manager/zypper.rs b/policies/module-types/system-updates/src/package_manager/zypper.rs index 6acf99502de..3f4a4c547e0 100644 --- a/policies/module-types/system-updates/src/package_manager/zypper.rs +++ b/policies/module-types/system-updates/src/package_manager/zypper.rs @@ -69,7 +69,7 @@ impl LinuxPackageManager for ZypperPackageManager { fn upgrade(&mut self, packages: Vec) -> ResultOutput<()> { let mut c = Command::new("zypper"); - c.arg("--non-interactive").arg("--name").arg("update"); + c.arg("--non-interactive").arg("update"); c.args(packages.into_iter().map(Self::package_spec_as_argument)); let res_update = ResultOutput::command(c); res_update.clear_ok() diff --git a/webapp/sources/api-doc/openapi.src.yml b/webapp/sources/api-doc/openapi.src.yml index 4b0c3ad709f..1d364592307 100644 --- a/webapp/sources/api-doc/openapi.src.yml +++ b/webapp/sources/api-doc/openapi.src.yml @@ -251,9 +251,10 @@ paths: "/nodes/status": $ref: paths/nodes/status.yml "/nodes/pending": - $ref: paths/nodes/pending-all.yml - "/nodes/pending": - $ref: paths/nodes/pending-update.yml + get: + $ref: paths/nodes/pending-all.yml + post: + $ref: paths/nodes/pending-update.yml "/nodes/{nodeId}": $ref: paths/nodes/id.yml "/nodes/pending/{nodeId}": diff --git a/webapp/sources/api-doc/paths/nodes/pending-all.yml b/webapp/sources/api-doc/paths/nodes/pending-all.yml index 4c0793ddd0a..085e3d8cd39 100644 --- a/webapp/sources/api-doc/paths/nodes/pending-all.yml +++ b/webapp/sources/api-doc/paths/nodes/pending-all.yml @@ -1,6 +1,5 @@ # SPDX-License-Identifier: CC-BY-SA-2.0 # SPDX-FileCopyrightText: 2013-2020 Normation SAS -get: summary: List pending nodes description: Get information about the nodes pending acceptation operationId: listPendingNodes diff --git a/webapp/sources/api-doc/paths/nodes/pending-update.yml b/webapp/sources/api-doc/paths/nodes/pending-update.yml index 91090adfa93..743541fa513 100644 --- a/webapp/sources/api-doc/paths/nodes/pending-update.yml +++ b/webapp/sources/api-doc/paths/nodes/pending-update.yml @@ -1,6 +1,5 @@ # SPDX-License-Identifier: CC-BY-SA-2.0 # SPDX-FileCopyrightText: 2013-2024 Normation SAS -post: summary: Update pending nodes status description: Accept or refuse one or many pending nodes operationId: changePendingNodesStatus