slapos.util: chownDirectory: Add support for different executable locations.

parent 2c127655
......@@ -53,7 +53,12 @@ def chownDirectory(path, uid, gid):
subprocess.check_call(['/bin/chown', '-R', '%s:%s' % (uid, gid), path])
else:
# we are probably inside webrunner
subprocess.check_call(['/bin/chgrp', '-R', '%s' % gid, path])
chgrp_location = '/bin/chgrp'
if not os.path.exists(chgrp_location):
chgrp_location = '/usr/bin/chgrp'
if not os.path.exists(chgrp_location):
chgrp_location = 'chgrp'
subprocess.check_call([chgrp_location, '-R', '%s' % gid, path])
def parse_certificate_key_pair(html):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment