def _mv_contents(path, new_path):
"""
Try to move the contents of path to tmp_path. Return True/False.
NOTE: Invoking `mv` as shutil.move() was not preserving ownership metadata.
"""
for entry in os.listdir(path):
cmd = "mv {}/{} {}".format(path, entry, new_path)
_rc, _stdout, _stderr = _run(cmd)
if _rc != 0:
return False
return True
# pylint: disable=too-many-return-statements
评论列表
文章目录