Local commands unsupported in fabric >=2?
See original GitHub issueDo you have a local example?
Is local support totally unsupported since version 1 fabric? There’s no good docs by example, and the methods / support is non-existent now.
fab -f fabfile.py log_local
No idea what 'log_local' is!
python
from fabric import Connection
from invoke import task, Exit
from invocations.console import confirm
# pip install invocations
@task
def log_local(c):
"""[Run ls -la on localhost]
Arguments:
c {[Connection]} -- [Explicit initial context argument, whose value will be a Connection object at runtime.]
"""
c.local('ls -la')
This was following example here https://github.com/fabric/fabric/issues/1747
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Developers - Local commands unsupported in fabric >=2? -
Is local support totally unsupported since version 1 fabric? There's no good docs by example, and the methods / support is non-existent now....
Read more >Hyperledger Fabric Local Fabric binary version does not ...
Hi.. I am trying to upgrade Hyperledger Fabric. To do this, i ran the following commands: ./byfn.sh down git fetch origin git checkout ......
Read more >error while deploying bna file to local hyperledger fabric
I have installed all the tools as required and mentioned on hyperledger.github.io/composer/installing/development-tools.html with the correct ...
Read more >Error - Creating Channel - fabric@lists.hyperledger.org
Command used : /home/hduser/fabric-tools/bin/configtxgen -profile ... 002 Error reading configuration: Unsupported Config Type "" 2018-02-12 ...
Read more >Cisco DCNM LAN Fabric Configuration Guide, Release 11.4(1)
Post DCNM 11.4(1) Upgrade for VXLAN BGP EVPN, External, and MSD Fabrics; Changing ISIS Configuration from Level 1 to Level 2; Configuration ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can ensure
c
is always a fabricConnection
by giving a default host name totask()
:But I also wonder why the author chose this behaviour (changing the type of
c
depending onhost
value). I would much prefer ifc
was always a fabricConnection
, withc.local == c.run
if no host is given.Hey @jondkelley @thrownblown
tldr; use
run
instead oflocal
and don’t specify the--hosts
flaglocal
commands are supported but now there is no difference betweenrun
andlocal
. If you don’t specify--hosts
, then theConnection
object falls back to being a regularContext
object from invoke, andrun
works locallyTry this fabfile:
Running
fab test
will print ‘HELLO’, plusc
, which will be aContext
object.Running
fab --hosts=<host connection string> test
will print ‘HELLO’ plusc
which will be aConnection
object