mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix traceback and incorrect message when resolving an unresolvable SID
This commit is contained in:
parent
8787d02688
commit
9572aabb67
1 changed files with 2 additions and 2 deletions
|
@ -1133,7 +1133,7 @@ def get_name(principal):
|
|||
|
||||
try:
|
||||
return win32security.LookupAccountSid(None, sid_obj)[0]
|
||||
except TypeError:
|
||||
except (pywintypes.error, TypeError):
|
||||
raise CommandExecutionError(
|
||||
'Could not find User for {0}'.format(principal))
|
||||
|
||||
|
@ -1173,7 +1173,7 @@ def get_owner(obj_name):
|
|||
owner_sid = 'S-1-1-0'
|
||||
else:
|
||||
raise CommandExecutionError(
|
||||
'Failed to set permissions: {0}'.format(exc.strerror))
|
||||
'Failed to get owner: {0}'.format(exc.strerror))
|
||||
|
||||
return get_name(win32security.ConvertSidToStringSid(owner_sid))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue