mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixed splitting of role/user name when username has a '.' in it
This may still be an issue if users create roles with a '.' in the name though. We will probably have to disallow that in the role naming convention.
This commit is contained in:
parent
d8d1152940
commit
ccbc99fe4f
1 changed files with 4 additions and 1 deletions
|
@ -241,7 +241,10 @@ def api_lookup_role_by_name(api_server, role_name):
|
|||
role_name = urllib.quote(role_name)
|
||||
|
||||
try:
|
||||
user_name,role_name = role_name.split(".", 1)
|
||||
parts = role_name.split(".")
|
||||
user_name = ".".join(parts[0:-1])
|
||||
role_name = parts[-1]
|
||||
print " downloading role '%s', owned by %s" % (role_name, user_name)
|
||||
except:
|
||||
print "Invalid role name (%s). You must specify username.rolename" % role_name
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in a new issue