Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions openpod/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
# Triggered by the user from the web interface to update the current version.

import os
import sys
import shutil
import zipfile
from distutils.dir_util import copy_tree

import urllib.request
import requests
Expand Down Expand Up @@ -46,9 +46,10 @@ def update_pod():

# Copy the files to the root directory.
os.makedirs(f"/opt/OpenPod/versions/{latest_version['hash']}/", exist_ok=True)
shutil.move(
f"OpenPod-{latest_version['hash']}/openpod/",
f"/opt/OpenPod/versions/{latest_version['hash']}/"

copy_tree(
f"OpenPod-{latest_version['hash']}/openpod",
f"/opt/OpenPod/versions/{latest_version['hash']}"
)

except RuntimeError as err:
Expand All @@ -58,8 +59,8 @@ def update_pod():

else:
# Update the version number in the config file.
op_config.set('version', latest_version['version'])
op_config.set(['OpenPod', 'commit'], latest_version['hash'])
op_config.set_value('version', latest_version['version'])
op_config.set_nested_value(['OpenPod', 'commit'], latest_version['hash'])

finally:
# Clean Up
Expand Down