Skip to content

Commit b1879d4

Browse files
authored
Merge pull request #142 from victormlg/fix-agent-cmd
CFE-4557: Fixed agent bootstrap command to run correct cf-agent path
2 parents 5382075 + d931ec7 commit b1879d4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cf_remote/commands.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,16 +941,22 @@ def deploy(hubs, masterfiles):
941941

942942
def agent(hosts, bootstrap=None):
943943

944-
command = "cf-agent"
945-
if bootstrap:
946-
command += " --bootstrap {}".format(bootstrap)
944+
if len(bootstrap) > 1:
945+
user_error(
946+
"Cannot boostrap {} to {}. Cannot bootstrap to more than one host.".format(
947+
hosts, bootstrap
948+
)
949+
)
950+
951+
hub_host = bootstrap[0]
947952

948953
for host in hosts:
949954
data = get_info(host)
950955

951-
if not data["agent_version"]:
956+
if not data["agent_location"]:
952957
user_error("CFEngine not installed on {}".format(host))
953958

959+
command = "{} --bootstrap {}".format(data["agent_location"], hub_host)
954960
output = run_command(host, command, sudo=True)
955961
if output:
956962
print(output)

0 commit comments

Comments
 (0)