mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 03:46:55 +00:00
Improve language.
This commit is contained in:
@@ -86,7 +86,7 @@ options:
|
||||
# - key: extra_env
|
||||
# section: docker_connection
|
||||
# ansible-core's config manager does NOT support converting JSON strings (or other things) to dictionaries,
|
||||
# it only accepts actual dictionaries (which don't happen to come from env and ini vars). So there's no way
|
||||
# it only accepts actual dictionaries (which do not happen to come from env and ini vars). So there's no way
|
||||
# to actually provide this parameter from env and ini sources... :-(
|
||||
vars:
|
||||
- name: ansible_docker_extra_env
|
||||
@@ -153,7 +153,7 @@ class Connection(ConnectionBase):
|
||||
# Note: docker supports running as non-root in some configurations.
|
||||
# (For instance, setting the UNIX socket file to be readable and
|
||||
# writable by a specific UNIX group and then putting users into that
|
||||
# group). Therefore we don't check that the user is root when using
|
||||
# group). Therefore we do not check that the user is root when using
|
||||
# this connection. But if the user is getting a permission denied
|
||||
# error it probably means that docker on their system is only
|
||||
# configured to be connected to by root and they are not running as
|
||||
@@ -333,9 +333,9 @@ class Connection(ConnectionBase):
|
||||
.format(self.docker_version, self.actual_user or u'?'))
|
||||
return actual_user
|
||||
elif self._display.verbosity > 2:
|
||||
# Since we're not setting the actual_user, look it up so we have it for logging later
|
||||
# Since we are not setting the actual_user, look it up so we have it for logging later
|
||||
# Only do this if display verbosity is high enough that we'll need the value
|
||||
# This saves overhead from calling into docker when we don't need to.
|
||||
# This saves overhead from calling into docker when we do not need to.
|
||||
return self._get_docker_remote_user()
|
||||
else:
|
||||
return None
|
||||
@@ -418,11 +418,11 @@ class Connection(ConnectionBase):
|
||||
''' Make sure that we put files into a standard path
|
||||
|
||||
If a path is relative, then we need to choose where to put it.
|
||||
ssh chooses $HOME but we aren't guaranteed that a home dir will
|
||||
exist in any given chroot. So for now we're choosing "/" instead.
|
||||
ssh chooses $HOME but we are not guaranteed that a home dir will
|
||||
exist in any given chroot. So for now we are choosing "/" instead.
|
||||
This also happens to be the former default.
|
||||
|
||||
Can revisit using $HOME instead if it's a problem
|
||||
Can revisit using $HOME instead if it is a problem
|
||||
'''
|
||||
if getattr(self._shell, "_IS_WINDOWS", False):
|
||||
import ntpath
|
||||
@@ -444,7 +444,7 @@ class Connection(ConnectionBase):
|
||||
"file or module does not exist: %s" % to_native(in_path))
|
||||
|
||||
out_path = shlex_quote(out_path)
|
||||
# Older docker doesn't have native support for copying files into
|
||||
# Older docker does not have native support for copying files into
|
||||
# running containers, so we use docker exec to implement this
|
||||
# Although docker version 1.8 and later provide support, the
|
||||
# owner and group of the files are always set to root
|
||||
@@ -490,7 +490,7 @@ class Connection(ConnectionBase):
|
||||
actual_out_path = os.path.join(out_dir, os.path.basename(in_path))
|
||||
|
||||
if p.returncode != 0:
|
||||
# Older docker doesn't have native support for fetching files command `cp`
|
||||
# Older docker does not have native support for fetching files command `cp`
|
||||
# If `cp` fails, try to use `dd` instead
|
||||
args = self._build_exec_cmd([self._play_context.executable, "-c", "dd if=%s bs=%s" % (in_path, BUFSIZE)])
|
||||
args = [to_bytes(i, errors='surrogate_or_strict') for i in args]
|
||||
|
||||
Reference in New Issue
Block a user