#! 'Client' object has no attribute 'host'

1 messages · Page 1 of 1 (latest)

viscid sun
#

Getting this error running dag.host().unix_socket(sshAuthSock)
I edited a git repo and want to push it back using the ssh auth sock
tell me if there is a better way. Thanks

sterile shale
#

the dag variable in a module doesn't have a host function

viscid sun
#

I'm confused how to run dagger functions outside a module. If I write anything outside of dagger/src/neuralbey_cicd/main.py dagger commend does not see it anymore and is not listed in dagger functions.

#

i'm using python sdk

sterile shale
#

from there, your module can import other files and make the necessary calls it needs

#

@viscid sun is there any chance you can provide a concrete example of what you're trying to do here?

viscid sun
#

Then do I need to define a function outside the main to use dag.host() then import it and call it in the main.py

#

what i want to do is puch back a repo to git dag.container().from_("alpine").with_exec(["apk", "--no-cache", "add", "git", "openssh-client"]).with_unix_socket(sshAuthSock, dag.host().unix_socket(sshAuthSock)).with_env_variable(sshSockEnvName, sshAuthSock).with_file("~/.ssh/known_hosts", dag.host().file("~/.ssh/known_hosts")).with_directory("/src", self.gitops(source)).with_workdir("/src").with_exec([""])

#

Then run these commends:

#

git config --global user.email "habibvs123@protonmail.com"
git config --global user.name "habib"
git add guestbook-ui-deployment.yaml
git commit -m "CI Deploy to 2"
git push origin master

sterile shale
#

the way to do this is by sending the sshAuthSock in your function arguments