Only chown recipe directory if it already exists
Since creation of the directory has been moved after switching users this now needs to check to make sure it exists first.
This commit is contained in:
parent
0e3b87a1da
commit
85ee784efc
@ -181,9 +181,10 @@ if __name__ == '__main__':
|
||||
server.config["COMPOSER_CFG"] = configure(conf_file=opts.config)
|
||||
|
||||
# Make sure the git repo can be accessed by the API uid/gid
|
||||
repodir_stat = os.stat(opts.RECIPES)
|
||||
if repodir_stat.st_gid != gid or repodir_stat.st_uid != uid:
|
||||
subprocess.call(["chown", "-R", "%s:%s" % (opts.user, opts.group), opts.RECIPES])
|
||||
if os.path.exists(opts.RECIPES):
|
||||
repodir_stat = os.stat(opts.RECIPES)
|
||||
if repodir_stat.st_gid != gid or repodir_stat.st_uid != uid:
|
||||
subprocess.call(["chown", "-R", "%s:%s" % (opts.user, opts.group), opts.RECIPES])
|
||||
|
||||
# If the user passed in a releasever set it in the configuration
|
||||
if opts.releasever:
|
||||
|
Loading…
Reference in New Issue
Block a user