Revert "zuul-cloner: enter directory before copying"
This reverts commit 26b66a6a9e
.
It doesn't seem we can stop "--preserve=all" from modifying the
directory permissions. Remove the -a and just do a regular copy.
Change-Id: I4937924e0dd1a0537343472f80b991a4e4410d3f
This commit is contained in:
parent
26b66a6a9e
commit
38a46bcf21
@ -16,7 +16,6 @@
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
@ -145,13 +144,15 @@ def main():
|
||||
print("Creating %s" % d)
|
||||
os.makedirs(d)
|
||||
|
||||
# Create hard link copy of the source directory. Note we cd
|
||||
# into the target directory to avoid "cp -a" modifying the
|
||||
# permissions of dst itself, which in particular can be fatal
|
||||
# to ssh access when dst is a homedir
|
||||
cmd = "cd %s; cp -al %s/. ." % (dst, src)
|
||||
# Create hard link copy of the source directory
|
||||
|
||||
# note: don't use "-a" here as that implies "--preserve=all"
|
||||
# which overwrites the permissions of dst from src ... this is
|
||||
# fatal to ssh if dst is a home directory and we make it
|
||||
# world-accessable. This should leave dst alone
|
||||
cmd = "cp -dRl %s/. %s" % (src, dst)
|
||||
print("%s" % cmd)
|
||||
if subprocess.call(cmd, shell=True) != 0:
|
||||
if os.system(cmd):
|
||||
print("Error executing: %s" % cmd)
|
||||
sys.exit(1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user