1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-19 22:33:25 +01:00

Bugfix for OTAs.

This commit is contained in:
Markus Birth 2018-01-19 11:39:58 +01:00
parent 2c506fb4e1
commit dc04714e10
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 8 additions and 4 deletions

View File

@ -70,9 +70,10 @@ req_xml = fc.do_request(curef, fv, tv, fw_id)
print(fc.pretty_xml(req_xml)) print(fc.pretty_xml(req_xml))
fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml) fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml)
chksum_xml = fc.do_checksum(random.choice(encslaves), fileurl, fileurl) if len(encslaves) > 0:
print(fc.pretty_xml(chksum_xml)) chksum_xml = fc.do_checksum(random.choice(encslaves), fileurl, fileurl)
file_addr, sha1_body, sha1_enc_footer, sha1_footer = fc.parse_checksum(chksum_xml) print(fc.pretty_xml(chksum_xml))
file_addr, sha1_body, sha1_enc_footer, sha1_footer = fc.parse_checksum(chksum_xml)
for s in slaves: for s in slaves:
print("http://{}{}".format(s, fileurl)) print("http://{}{}".format(s, fileurl))

View File

@ -383,7 +383,10 @@ class FotaCheck:
file = root.find("FILE_LIST").find("FILE") file = root.find("FILE_LIST").find("FILE")
fileid = file.find("FILE_ID").text fileid = file.find("FILE_ID").text
fileurl = file.find("DOWNLOAD_URL").text fileurl = file.find("DOWNLOAD_URL").text
s3_fileurl = file.find("S3_DOWNLOAD_URL").text s3_fileurl_node = file.find("S3_DOWNLOAD_URL")
s3_fileurl = ""
if s3_fileurl_node:
s3_fileurl = s3_fileurl_node.text
slave_list = root.find("SLAVE_LIST").findall("SLAVE") slave_list = root.find("SLAVE_LIST").findall("SLAVE")
enc_list = root.find("SLAVE_LIST").findall("ENCRYPT_SLAVE") enc_list = root.find("SLAVE_LIST").findall("ENCRYPT_SLAVE")
s3_slave_list = root.find("SLAVE_LIST").findall("S3_SLAVE") s3_slave_list = root.find("SLAVE_LIST").findall("S3_SLAVE")