-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange remote environment variable causes error #162
Comments
I managed to make it work by modifying RemoteEnv constructor like this: class RemoteEnv(BaseEnv):
"""The remote machine's environment; exposes a dict-like interface"""
__slots__ = ["_orig", "remote"]
def __init__(self, remote):
self.remote = remote
lines = self.remote._session.run("env")[1].splitlines()
for i, l in enumerate(lines[:]):
if "=" not in l:
lines[i-1] += "\n" + l
del lines[i]
self._curr = dict(line.split("=", 1) for line in lines)
self._orig = self._curr.copy()
BaseEnv.__init__(self, self.remote.path, ":") it's quite awful I'm afraid... |
but you didn't say what the bug was :) -tomer Tomer Filiba On Mon, Nov 3, 2014 at 1:22 AM, Pierre Gay notifications@github.com wrote:
|
I thought I had said it in the first post ;) Anyway: It's that the way you get environment doesn't cope multiline variables correctly: When you call My fix proposal is horrible, but I can't find something better for the moment. |
Hi, I'm also experiencing this issue - could this be patched? :) |
I've also been hitting this. I have the following environment variable that breaks due to This seems to fix it:
Although I'm not sure how cross-platform the UPDATE: Hm, turns out that doesn't actually work (seems to break gathering the returncode):
|
Awesome, thanks @tomerfiliba (sorry about the broken 'fix' i suggested)! |
Thanks @tomerfiliba ;) |
Hi,
with a SshMachine, strange remote environment variable causes an error:
The environment that causes this error is the second part of a function definition. Here is what appears with an
env
command on the remote machine:The return character in BASH_FUNC_module causes an error in
machines/remote.py
because of splitline call, I think.Would it be ok to simply catch the ValuerError, or to use a more complicated parsing method?
Regards,
Pierre
The text was updated successfully, but these errors were encountered: