From 711b51fad65a7b619b8f9a5f0219b8eddc8bb1fe Mon Sep 17 00:00:00 2001 From: Wouter Schoot Date: Thu, 26 May 2022 19:55:02 +0200 Subject: [PATCH] Remove double spaces in errormessage (#77839) --- lib/ansible/galaxy/dependency_resolution/dataclasses.py | 2 +- .../ansible-galaxy-collection-scm/tasks/requirements.yml | 2 +- test/units/cli/test_galaxy.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/galaxy/dependency_resolution/dataclasses.py b/lib/ansible/galaxy/dependency_resolution/dataclasses.py index ead07d85fb5..60015dbfe76 100644 --- a/lib/ansible/galaxy/dependency_resolution/dataclasses.py +++ b/lib/ansible/galaxy/dependency_resolution/dataclasses.py @@ -338,7 +338,7 @@ class _ComputedReqKindsMixin: 'not an FQCN. A valid collection name must be in ' 'the format .. Please make ' 'sure that the namespace and the collection name ' - ' contain characters from [a-zA-Z0-9_] only.' + 'contain characters from [a-zA-Z0-9_] only.' '{extra_tip!s}'.format(extra_tip=tip), ) diff --git a/test/integration/targets/ansible-galaxy-collection-scm/tasks/requirements.yml b/test/integration/targets/ansible-galaxy-collection-scm/tasks/requirements.yml index c774342662d..10070f1a052 100644 --- a/test/integration/targets/ansible-galaxy-collection-scm/tasks/requirements.yml +++ b/test/integration/targets/ansible-galaxy-collection-scm/tasks/requirements.yml @@ -30,7 +30,7 @@ nor 'source' point to a concrete resolvable collection artifact. Also 'name' is not an FQCN. A valid collection name must be in the format .. Please make sure that the - namespace and the collection name contain characters from + namespace and the collection name contain characters from [a-zA-Z0-9_] only." in result.stderr - name: test source is not a git repo even if name is provided diff --git a/test/units/cli/test_galaxy.py b/test/units/cli/test_galaxy.py index 3b975beedd8..faaf64dec86 100644 --- a/test/units/cli/test_galaxy.py +++ b/test/units/cli/test_galaxy.py @@ -631,7 +631,7 @@ def test_invalid_collection_name_install(name, expected, tmp_path_factory): # Used to be: expected = "Invalid collection name '%s', name must be in the format ." % expected expected = "Neither the collection requirement entry key 'name', nor 'source' point to a concrete resolvable collection artifact. " expected += r"Also 'name' is not an FQCN\. A valid collection name must be in the format \.\. " - expected += r"Please make sure that the namespace and the collection name contain characters from \[a\-zA\-Z0\-9_\] only\." + expected += r"Please make sure that the namespace and the collection name contain characters from \[a\-zA\-Z0\-9_\] only\." gc = GalaxyCLI(args=['ansible-galaxy', 'collection', 'install', name, '-p', os.path.join(install_path, 'install')]) with pytest.raises(AnsibleError, match=expected): @@ -1093,7 +1093,7 @@ def test_parse_requirements_without_mandatory_name_key(requirements_cli, require expected = "Neither the collection requirement entry key 'name', nor 'source' point to a concrete resolvable collection artifact. " expected += r"Also 'name' is not an FQCN\. A valid collection name must be in the format \.\. " - expected += r"Please make sure that the namespace and the collection name contain characters from \[a\-zA\-Z0\-9_\] only\." + expected += r"Please make sure that the namespace and the collection name contain characters from \[a\-zA\-Z0\-9_\] only\." with pytest.raises(AnsibleError, match=expected): requirements_cli._parse_requirements_file(requirements_file)