Files
runc/script/hook.py
T
Mrunal Patel 1dca365393 Add test for prestart hook
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Conflicts:
	libcontainer/integration/exec_test.go
2015-09-10 17:59:36 -07:00

16 lines
291 B
Python
Executable File

#!/usr/bin/env python
import sys
import json
import os
def touch(filepath):
if os.path.exists(filepath):
os.utime(filepath, None)
else:
open(filepath, 'a').close()
if __name__ == "__main__":
rootfs = json.load(sys.stdin)["config"]["rootfs"]
touch(os.path.join(rootfs, "tmp.txt"))