Skip to content

Commit e2333ff

Browse files
author
github-actions
committed
Merge remote-tracking branch 'origin/master-ci' into dev-release
2 parents 4925ecb + ad82962 commit e2333ff

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

openpod/updater.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# Triggered by the user from the web interface to update the current version.
99

1010
import os
11-
import sys
1211
import shutil
1312
import zipfile
13+
from distutils.dir_util import copy_tree
1414

1515
import urllib.request
1616
import requests
@@ -46,9 +46,10 @@ def update_pod():
4646

4747
# Copy the files to the root directory.
4848
os.makedirs(f"/opt/OpenPod/versions/{latest_version['hash']}/", exist_ok=True)
49-
shutil.move(
50-
f"OpenPod-{latest_version['hash']}/openpod/",
51-
f"/opt/OpenPod/versions/{latest_version['hash']}/"
49+
50+
copy_tree(
51+
f"OpenPod-{latest_version['hash']}/openpod",
52+
f"/opt/OpenPod/versions/{latest_version['hash']}"
5253
)
5354

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

5960
else:
6061
# Update the version number in the config file.
61-
op_config.set('version', latest_version['version'])
62-
op_config.set(['OpenPod', 'commit'], latest_version['hash'])
62+
op_config.set_value('version', latest_version['version'])
63+
op_config.set_nested_value(['OpenPod', 'commit'], latest_version['hash'])
6364

6465
finally:
6566
# Clean Up

0 commit comments

Comments
 (0)