mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Clean up code comments
This commit is contained in:
parent
b383b9b330
commit
9302fa5ab0
1 changed files with 3 additions and 5 deletions
|
@ -1128,20 +1128,18 @@ def get_name(principal):
|
|||
# If None is passed, use the Universal Well-known SID for "Null SID"
|
||||
if principal is None:
|
||||
principal = 'S-1-0-0'
|
||||
|
||||
# String SID
|
||||
# Try Converting String SID to SID Object first as it's least expensive
|
||||
try:
|
||||
sid_obj = win32security.ConvertStringSidToSid(principal)
|
||||
except pywintypes.error:
|
||||
|
||||
# Name
|
||||
# Try Getting the SID Object by Name Lookup last
|
||||
# This is expensive, especially on large AD Domains
|
||||
try:
|
||||
sid_obj = win32security.LookupAccountName(None, principal)[0]
|
||||
except pywintypes.error:
|
||||
# Just pass the object and let the LookupAccountSid function try
|
||||
# This is not a PySID object, a SID String, or a valid Account
|
||||
# Name. Just pass it and let the LookupAccountSid function try
|
||||
# to resolve it
|
||||
sid_obj = principal
|
||||
|
||||
# By now we should have a valid PySID object
|
||||
|
|
Loading…
Add table
Reference in a new issue