strip extra whitespace from regex match on roles

This commit is contained in:
Daniel Wallace 2016-04-14 16:36:06 -05:00
parent 2241ec537e
commit b0962011b4

View File

@ -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