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

使用bash代替python完成建立777目录的功能
pull/234/head
ibuler 2016-05-11 11:10:02 +08:00
parent 1338d25b4e
commit 18e159350b
1 changed files with 2 additions and 3 deletions

View File

@ -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)