From cc11d8f38f6a2f9dd46904272808bb25dac042b8 Mon Sep 17 00:00:00 2001 From: Alvaro Neira Ayuso Date: Fri, 3 Jan 2020 11:33:25 +0100 Subject: Add restore/image command for restoring images on the machine ogAdmClient has a support to restore image on the machine. This new command allows the new ogClient to execute the same script to restore the images on the machine. The json format sent from the server must be: { "disk" : "1", "partition" : "1", "name" : "test",\ "repository" : "192.168.56.10", "type" : "UNICAST", "profile": "1", "id": "1"} --- src/linux/ogOperations.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/linux') diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py index bbc3b1a..bbdfa3d 100644 --- a/src/linux/ogOperations.py +++ b/src/linux/ogOperations.py @@ -40,3 +40,7 @@ def procsetup(disk, cache, cachesize, partlist): for part in partlist: cfg = 'dis=' + disk + '*che=' + cache + '*tch=' + cachesize + '!par=' + part["partition"] + '*cpt='+part["code"] + '*sfi=' + part['filesystem'] + '*tam=' + part['size'] + '*ope=' + part['format'] + '%' subprocess.check_output([OG_PATH + 'interfaceAdm/Configurar', disk, cfg], shell=True) + +def procirestore(disk, partition, name, repo, ctype, profile, cid): + result = subprocess.check_output([OG_PATH + 'interfaceAdm/RestaurarImagen', disk, partition, name, repo, ctype], shell=True) + return result.decode('utf-8') -- cgit v1.2.3-18-g5258