mirror of https://github.com/jumpserver/jumpserver
parent
1338d25b4e
commit
18e159350b
|
@ -463,9 +463,8 @@ def mkdir(dir_name, username='', mode=0755):
|
|||
insure the dir exist and mode ok
|
||||
目录存在,如果不存在就建立,并且权限正确
|
||||
"""
|
||||
if not os.path.isdir(dir_name):
|
||||
os.makedirs(dir_name)
|
||||
os.chmod(dir_name, mode)
|
||||
cmd = 'mkdir -p %s && chmod %s %s' % (dir_name, mode, dir_name)
|
||||
bash(cmd)
|
||||
if username:
|
||||
chown(dir_name, username)
|
||||
|
||||
|
|
Loading…
Reference in New Issue