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
|
insure the dir exist and mode ok
|
||||||
目录存在,如果不存在就建立,并且权限正确
|
目录存在,如果不存在就建立,并且权限正确
|
||||||
"""
|
"""
|
||||||
if not os.path.isdir(dir_name):
|
cmd = 'mkdir -p %s && chmod %s %s' % (dir_name, mode, dir_name)
|
||||||
os.makedirs(dir_name)
|
bash(cmd)
|
||||||
os.chmod(dir_name, mode)
|
|
||||||
if username:
|
if username:
|
||||||
chown(dir_name, username)
|
chown(dir_name, username)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue