Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
There are some misuses of os.path.dirname(path) in Ambari code base. For example, the following code wrongly sets the permission of /ats/done to 0755 when params.entity_groupfs_store_dir is /ats/done/ (with trailing /).
yarn.py
parent_path = os.path.dirname(params.entity_groupfs_store_dir)
params.HdfsResource(parent_path,
type="directory",
change_permissions_for_parents=True,
owner=params.yarn_user,
group=params.user_group,
mode=0755
)
This is because os.path.dirname(path) does not return the parent directory if the path ends with '/'.
$ python >>> import os >>> os.path.dirname('/ats/done/') '/ats/done'
Attachments
1.
|
Fix misuses of os.path.dirname(path) in yarn.py | Resolved | Akira Ajisaka |
|