collection: Provide additional info about collection name restriction (#65250)
Fixes: #65151 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
cd8b42c376
commit
9dca2bd3c4
3 changed files with 7 additions and 2 deletions
2
changelogs/fragments/collection_error_fix.yml
Normal file
2
changelogs/fragments/collection_error_fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- Provides additional information about collection namespace name restrictions (https://github.com/ansible/ansible/issues/65151).
|
|
@ -454,7 +454,10 @@ def validate_collection_name(name):
|
|||
if AnsibleCollectionRef.is_valid_collection_name(collection):
|
||||
return name
|
||||
|
||||
raise AnsibleError("Invalid collection name '%s', name must be in the format <namespace>.<collection>." % name)
|
||||
raise AnsibleError("Invalid collection name '%s', "
|
||||
"name must be in the format <namespace>.<collection>. "
|
||||
"Please make sure namespace and collection name contains "
|
||||
"characters from [a-zA-Z0-9_] only." % name)
|
||||
|
||||
|
||||
@contextmanager
|
||||
|
|
|
@ -474,7 +474,7 @@ class AnsibleCollectionRef:
|
|||
@staticmethod
|
||||
def is_valid_collection_name(collection_name):
|
||||
"""
|
||||
Validates if is string is a well-formed collection name (does not look up the collection itself)
|
||||
Validates if the given string is a well-formed collection name (does not look up the collection itself)
|
||||
:param collection_name: candidate collection name to validate (a valid name is of the form 'ns.collname')
|
||||
:return: True if the collection name passed is well-formed, False otherwise
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue