Comments (7)
Below is my current workaround for this issue:
def rsync_with_agent(ctx, *args, **kwargs):
"""Ugly workaround for https://github.com/fabric/patchwork/issues/16."""
ssh_agent = os.environ.get('SSH_AUTH_SOCK', None)
if ssh_agent:
ctx.config['run']['env']['SSH_AUTH_SOCK'] = ssh_agent
return rsync(ctx, *args, **kwargs)
from patchwork.
I am not able to use this workaround, still needing the password
from patchwork.
The reason seems to be replace_env = True
in the fabric/config.py
:
# TODO: as to that, this is a core problem, Fabric wants split
# local/remote stuff, eg replace_env wants to be False for local and
# True remotely; shell wants to differ depending on target (and either
# way, does not want to use local interrogation for remote)
# TODO: is it worth moving all of our 'new' settings to a discrete
# namespace for cleanliness' sake? e.g. ssh.port, ssh.user etc.
# It wouldn't actually simplify this code any, but it would make it
# easier for users to determine what came from which library/repo.
defaults = InvokeConfig.global_defaults()
ours = {
# New settings
'connect_kwargs': {},
'forward_agent': False,
'gateway': None,
'load_ssh_configs': True,
'port': 22,
'run': {
'replace_env': True,
},
'runners': {
'remote': Remote,
},
But I have no idea why it applies to local()
. Any workarounds?
from patchwork.
Probably has to do with the currently-too-thin boundary between run
and local
, there are outstanding issues there that need solving and this feels like an example of one of them.
Eg I think what needs to happen is vanilla-Invoke's run() wants to honor config.run.*
but Fabric 2 wants to clone config.run.*
to be config.local.*
so that the two can have differing defaults. That's a Fabric, not Patchwork, level change - to be clear.
I'm still trying to get Patchwork and Invocations both up to snuff re: being publication and pull request worthy, after that I'll get back to this sort of feature related work. PyCon sprints!
from patchwork.
I ran into the same issue and @max-arnold's workaround worked for me.
from patchwork.
This never got linked to fabric/fabric#1752 - once that is solved this may go away or at least be easier to fix.
from patchwork.
I'm having another problem related to this (problems with local
mentioned above), trying to run my django unit tests before deploying:
c.local('poetry run python manage.py test')
Gives me this:
[KeyError]
'PATH'
But running remotely with c.run
works just fine.
from patchwork.
Related Issues (20)
- Append some lines in README to explain the difference between patchwork and Fabtools
- Patchwork 0.2.0 not install [Python 3] HOT 1
- rsync() generates invalid rsync command line if IPv6 address used
- Exists function is crashing. HOT 1
- Calls to Result.succeeded fail HOT 1
- transfers.rsync() error when excluding tuple HOT 2
- py3 compatibility - iteritems HOT 3
- rsync not found on windows system HOT 1
- `transfers.rsync` don't support rsync from remote to local
- Porting the files.sed operation? HOT 2
- Docker module
- files.append with sudo failed HOT 3
- Add installation instructions HOT 1
- 'transfers.rsync' hangs if host not accessible
- single quotes not properly escaped HOT 1
- What does patchwork.util.set_runner do?
- cannot import name 'six' from 'invoke.vendor' HOT 3
- support fabric 3.0 HOT 2
- files.exists relies on SSH commands
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patchwork.