diff options
author | Joffrey F <joffrey@docker.com> | 2017-12-04 22:47:33 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-12-05 16:21:49 -0800 |
commit | 79b20eb53f3c580b5202000708e9c39fae8f2c92 (patch) | |
tree | aa2d8a130c0486bf589946a5e663415703e4dbc7 /tests/helpers.py | |
parent | 6cd0bc48836cd06983c255aaad6be047ce4a0394 (diff) |
Add support for mount syntax
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index a93de993..f151f9cd 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -19,12 +19,8 @@ def build_config_details(contents, working_dir='working_dir', filename='filename ) -def create_host_file(client, filename): +def create_custom_host_file(client, filename, content): dirname = os.path.dirname(filename) - - with open(filename, 'r') as fh: - content = fh.read() - container = client.create_container( 'busybox:latest', ['sh', '-c', 'echo -n "{}" > {}'.format(content, filename)], @@ -48,3 +44,10 @@ def create_host_file(client, filename): return container_info['Node']['Name'] finally: client.remove_container(container, force=True) + + +def create_host_file(client, filename): + with open(filename, 'r') as fh: + content = fh.read() + + return create_custom_host_file(client, filename, content) |