-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added check if binaries are in path #109
Added check if binaries are in path #109
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you forgot to format the file with black
cf_remote/remote.py
Outdated
@@ -600,13 +600,23 @@ def deploy_masterfiles(host, tarball, *, connection=None): | |||
scp(tarball, host, connection=connection, rename="masterfiles.tgz") | |||
tarball = "masterfiles.tgz" | |||
ssh_cmd(connection, "tar -xzf %s" % tarball) | |||
|
|||
cfagent_path = "" | |||
if not ssh_cmd(connection, "command -v cf-agent"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we check if cf-agent
is in PATH
for the user we logged in as. However, we execute the commands below as root. Hence, cf-agent
may still not be in PATH
for the root user. Thus, we need to do this command as root as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to use sudo when doing if ssh_cmd(connection, "command -v /var/cfengine/bin/cf-agent"):
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, because that you are not using the PATH
environment variable :)
It would be nice if we printed an error if |
I created a ticket here: https://northerntech.atlassian.net/browse/CFE-4480 |
Ticket: CFE-4446 Signed-off-by: Victor Moene <[email protected]>
7521671
to
cf2e698
Compare
No description provided.