mirror of https://git.48k.eu/ogclient
src: remove call to restoreImageCustom script
remove call to custom version of legacy script, display warning.master
parent
9fa4a5f651
commit
1ca3992f71
|
@ -500,8 +500,9 @@ class OgLiveOperations:
|
||||||
logging.info(f'Request to restore image {name}.img via {ctype} from {repo}')
|
logging.info(f'Request to restore image {name}.img via {ctype} from {repo}')
|
||||||
|
|
||||||
if shutil.which('restoreImageCustom'):
|
if shutil.which('restoreImageCustom'):
|
||||||
restoreImageCustom(repo, name, disk, partition, ctype)
|
logging.warning(f'Ignoring restoreImageCustom, use postconfiguration scripts instead.')
|
||||||
elif 'UNICAST' in ctype:
|
|
||||||
|
if 'UNICAST' in ctype:
|
||||||
cache = 'DIRECT' not in ctype
|
cache = 'DIRECT' not in ctype
|
||||||
self._restore_image_unicast(repo, name, partdev, cache)
|
self._restore_image_unicast(repo, name, partdev, cache)
|
||||||
elif ctype == 'TIPTORRENT':
|
elif ctype == 'TIPTORRENT':
|
||||||
|
|
|
@ -215,22 +215,3 @@ def ogChangeRepo(ip, smb_user='opengnsys', smb_pass='og'):
|
||||||
subprocess.run(shlex.split(cmd))
|
subprocess.run(shlex.split(cmd))
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
||||||
|
|
||||||
def restoreImageCustom(repo_ip, image_name, disk, partition, method):
|
|
||||||
"""
|
|
||||||
"""
|
|
||||||
if not shutil.which('restoreImageCustom'):
|
|
||||||
raise OgError('restoreImageCustom not found')
|
|
||||||
|
|
||||||
cmd = f'restoreImageCustom {repo_ip} {image_name} {disk} {partition} {method}'
|
|
||||||
with open('/tmp/command.log', 'wb', 0) as logfile:
|
|
||||||
try:
|
|
||||||
proc = subprocess.run(cmd,
|
|
||||||
stdout=logfile,
|
|
||||||
encoding='utf-8',
|
|
||||||
shell=True,
|
|
||||||
check=True)
|
|
||||||
except OSError as e:
|
|
||||||
raise OgError(f'Error processing restoreImageCustom: {e}') from e
|
|
||||||
return proc.returncode
|
|
||||||
|
|
Loading…
Reference in New Issue