Browse Source

!1317 fix hook utils bug on creating new workspace

From: @liangyongxiong1024
Reviewed-by: @ouwenchang,@yelihua
Signed-off-by: @yelihua
pull/1317/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
e037cfd28a
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      mindinsight/utils/hook.py

+ 1
- 2
mindinsight/utils/hook.py View File

@@ -154,8 +154,7 @@ def init(workspace='', config='', **kwargs):
raise FileSystemPermissionError('Workspace {} not allowed to access'.format(workspace)) raise FileSystemPermissionError('Workspace {} not allowed to access'.format(workspace))
else: else:
try: try:
mode = permissions << 6
os.makedirs(settings.WORKSPACE, mode=mode, exist_ok=True)
os.makedirs(settings.WORKSPACE, mode=stat.S_IRWXU, exist_ok=True)
except OSError: except OSError:
# race condition or priority problem # race condition or priority problem
raise FileSystemPermissionError('Workspace {} not available'.format(workspace)) raise FileSystemPermissionError('Workspace {} not available'.format(workspace))


Loading…
Cancel
Save