summaryrefslogtreecommitdiff
path: root/lib/ansible/galaxy
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2019-12-04 07:36:37 +0530
committerMatt Davis <nitzmahone@users.noreply.github.com>2019-12-03 18:06:37 -0800
commit5a48f7ea6b9c4af7e5d8256a4d2502877eaec6d5 (patch)
tree8c4c2722ba065eae6ec85dec8109e363ab84b82a /lib/ansible/galaxy
parent4b9644c00bebbbe47480cb5a5de57d7fa3540ffb (diff)
downloadansible-5a48f7ea6b9c4af7e5d8256a4d2502877eaec6d5.tar.gz
[2.9] collection: Provide additional info about collection name restriction (#65276)
Fixes: #65151 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit 9dca2bd3c4fbc176d38ed14c8fdb79e3db218a6d)
Diffstat (limited to 'lib/ansible/galaxy')
-rw-r--r--lib/ansible/galaxy/collection.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ansible/galaxy/collection.py b/lib/ansible/galaxy/collection.py
index 72f342a08c..d1a1268a88 100644
--- a/lib/ansible/galaxy/collection.py
+++ b/lib/ansible/galaxy/collection.py
@@ -453,7 +453,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