question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What to do with the Connection object?

See original GitHub issue

Migrating to v2, I created a Connection object

import configparser
import os

import fabric

fabfile_config = configparser.ConfigParser()

fabfile_config.read('fabfile.cfg')

fabric.Connection(
    host=fabfile_config.get('Fabric', 'Host'),
    user=fabfile_config.get('Fabric', 'User'),
    connect_kwargs={
        'key_filename': os.path.expanduser(fabfile_config.get('Fabric', 'KeyFilename'))
    }
)

but

@fabric.task(help={'command': 'The shell command to execute on the server'})
def execute(context, command = None):
    if not command:
        return

    context.run(command)

is executing the command locally, instead of running it on the server.

Shouldn’t the context parameter be my connection?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
revoltercommented, Feb 20, 2021

Somehow, yes. I think that I was creating the connection object incorrectly. Here is the entire code that I use, let me know if there’s something you don’t understand.

0reactions
davidjmemmettcommented, Feb 22, 2021

Reading through it, it appears that you have resolved this issue yourself. Please re-open if this is not the case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection Object (ADO) - Microsoft Learn
A Connection object represents a unique session with a data source. In a client/server database system, it may be equivalent to an actual ......
Read more >
ADO Connection Object - W3Schools
The ADO Connection Object is used to create an open connection to a data source. Through this connection, you can access and manipulate...
Read more >
Connection Object
The ADO Connection object represents a single session with an OLE DB data source. It defines a physical connection to the data source...
Read more >
Connection (Java Platform SE 7 ) - Oracle Help Center
A Connection object's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this ......
Read more >
Understanding Connection Object - RoseIndia.Net
The DriverManager class, attempts to locate a driver that can connect to the database represented by the string URL. Whenever the getConnection() method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found