Avoid double-encoding to bytes
Both the 'container_user' used within the 'cmd' variable and the container path padding added to the 'out_file' variable in the connection plugin should be strings since they're later encoded to bytes by the inherited class. Change-Id: I8874c439fc9c006125bb39ff6a2cd386bfc8f561
This commit is contained in:
parent
30af08208d
commit
1670ccdbbd
@ -82,8 +82,7 @@ class Connection(SSH.Connection):
|
|||||||
# Remote user is normally set, but if it isn't, then default to 'root'
|
# Remote user is normally set, but if it isn't, then default to 'root'
|
||||||
container_user = 'root'
|
container_user = 'root'
|
||||||
if self._play_context.remote_user:
|
if self._play_context.remote_user:
|
||||||
container_user = SSH.to_bytes(self._play_context.remote_user,
|
container_user = self._play_context.remote_user
|
||||||
errors='surrogate_or_strict')
|
|
||||||
# NOTE(hwoarang) It is important to connect to the container
|
# NOTE(hwoarang) It is important to connect to the container
|
||||||
# without inheriting the host environment as that would interfere
|
# without inheriting the host environment as that would interfere
|
||||||
# with running commands and services inside the container. However,
|
# with running commands and services inside the container. However,
|
||||||
@ -151,7 +150,7 @@ class Connection(SSH.Connection):
|
|||||||
)
|
)
|
||||||
if returncode == 0:
|
if returncode == 0:
|
||||||
pad = os.path.join(
|
pad = os.path.join(
|
||||||
'/proc/%s/root' % stdout.strip(),
|
'/proc/%s/root' % SSH.to_text(stdout.strip()),
|
||||||
path.lstrip(os.sep)
|
path.lstrip(os.sep)
|
||||||
)
|
)
|
||||||
SSH.display.vvv(
|
SSH.display.vvv(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user