mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
strip extra whitespace from regex match on roles
This commit is contained in:
parent
2241ec537e
commit
b0962011b4
@ -211,7 +211,7 @@ def get_roles(username):
|
||||
info = sendline('show user-account {0}'.format(username))
|
||||
roles = re.search(r'^\s*roles:(.*)$', info, re.MULTILINE)
|
||||
if roles:
|
||||
roles = roles.group(1).split(' ')
|
||||
roles = roles.group(1).strip().split(' ')
|
||||
else:
|
||||
roles = []
|
||||
return roles
|
||||
|
Loading…
Reference in New Issue
Block a user