Skip to content

Commit

Permalink
fix: upgrade_root NONE bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ymj-123 committed Aug 11, 2020
1 parent 75aa351 commit d75889c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/aceinna/bootstrap/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def listen(self):
'''
Start to find device
'''
print("Python driver version: {0}".format(VERSION))
# start websocket server
webserver_thread = threading.Thread(target=self.start_webserver)
webserver_thread.start()
Expand Down
9 changes: 4 additions & 5 deletions src/aceinna/devices/base/uart_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,17 @@ def thread_do_upgrade_framework(self, file):

def _do_download_firmware(self, file):
upgarde_root = os.path.join(resource.get_executor_path(), 'upgrade')

firmware_content = None
if not os.path.exists(upgarde_root):
os.makedirs(upgarde_root)

del_list = os.listdir(upgarde_root)
for f in del_list:
file_path = os.path.join(upgarde_root, f)
if os.path.isfile(file_path):
os.remove(file_path)

firmware_content = None

if not os.path.exists(upgarde_root):
os.makedirs(upgarde_root)

firmware_file_path = os.path.join(upgarde_root, file)
firmware_file = Path(firmware_file_path)

Expand Down

0 comments on commit d75889c

Please sign in to comment.