MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / download_binary_from_ftp

Function download_binary_from_ftp

bootstrap.py:127–145  ·  view source on GitHub ↗
(host, apache_dir, release, binary)

Source from the content-addressed store, hash-verified

125
126
127def download_binary_from_ftp(host, apache_dir, release, binary):
128 successful_download = False
129
130 try:
131 ftp = FTP(host)
132 ftp.login()
133 ftp.cwd(apache_dir + MINIFI_SUBFOLDER + release)
134
135 print ("Downloading: ftp://" + host + "/" + MINIFI_SUBFOLDER + release + "/" + binary)
136
137 with open(os.path.join(os.getcwd(), binary), "wb") as targetfile:
138 ftp.retrbinary("RETR " + binary, targetfile.write)
139 successful_download = True
140 except:
141 print("Failed to download binary")
142 finally:
143 ftp.quit()
144
145 return successful_download
146
147
148def main(args):

Callers 1

mainFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected