Commit 18e15935 authored by ibuler's avatar ibuler

fix(api) 修改建立目录的bug

使用bash代替python完成建立777目录的功能
parent 1338d25b
...@@ -463,9 +463,8 @@ def mkdir(dir_name, username='', mode=0755): ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment