utils.utils

Module Contents

Functions

create_ipam_pool(*args,**kwargs)
create_ipam_config(*args,**kwargs)
decode_json_header(header)
compare_version(v1,v2) Compare docker versions
version_lt(v1,v2)
version_gte(v1,v2)
_convert_port_binding(binding)
convert_port_bindings(port_bindings)
convert_volume_binds(binds)
convert_tmpfs_mounts(tmpfs)
convert_service_networks(networks)
parse_repository_tag(repo_name)
parse_host(addr,is_win32=False,tls=False)
parse_devices(devices)
kwargs_from_env(ssl_version=None,assert_hostname=None,environment=None)
convert_filters(filters)
datetime_to_timestamp(dt) Convert a UTC datetime to a Unix timestamp
parse_bytes(s)
normalize_links(links)
parse_env_file(env_file) Reads a line-separated environment file.
split_command(command)
format_environment(environment)
format_extra_hosts(extra_hosts,task=False)
create_host_config(self,*args,**kwargs)
create_ipam_pool(*args, **kwargs)
create_ipam_config(*args, **kwargs)
decode_json_header(header)
compare_version(v1, v2)

Compare docker versions

>>> v1 = '1.9'
>>> v2 = '1.10'
>>> compare_version(v1, v2)
1
>>> compare_version(v2, v1)
-1
>>> compare_version(v2, v2)
0
version_lt(v1, v2)
version_gte(v1, v2)
_convert_port_binding(binding)
convert_port_bindings(port_bindings)
convert_volume_binds(binds)
convert_tmpfs_mounts(tmpfs)
convert_service_networks(networks)
parse_repository_tag(repo_name)
parse_host(addr, is_win32=False, tls=False)
parse_devices(devices)
kwargs_from_env(ssl_version=None, assert_hostname=None, environment=None)
convert_filters(filters)
datetime_to_timestamp(dt)

Convert a UTC datetime to a Unix timestamp

parse_bytes(s)
parse_env_file(env_file)

Reads a line-separated environment file. The format of each line should be “key=value”.

split_command(command)
format_environment(environment)
format_extra_hosts(extra_hosts, task=False)
create_host_config(self, *args, **kwargs)