File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88# Triggered by the user from the web interface to update the current version.
99
1010import os
11- import sys
1211import shutil
1312import zipfile
13+ from distutils .dir_util import copy_tree
1414
1515import urllib .request
1616import 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
You can’t perform that action at this time.
0 commit comments