mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Clean up the mode return on files
This commit is contained in:
parent
632375e010
commit
6861f2c0cb
@ -114,7 +114,10 @@ def get_mode(path):
|
||||
'''
|
||||
if not os.path.isfile(path):
|
||||
return -1
|
||||
return oct(os.stat(path).st_mode)[-4:]
|
||||
mode = str(oct(os.stat(path).st_mode)[-4:])
|
||||
if mode.startswith('0'):
|
||||
return mode[1:]
|
||||
return mode
|
||||
|
||||
def set_mode(path, mode):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user