diff options
author | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-01-03 11:33:25 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2020-01-19 19:50:44 +0100 |
commit | cc11d8f38f6a2f9dd46904272808bb25dac042b8 (patch) | |
tree | d960a847ec3bef69e2fd4e91ec06f05e23a1ae76 /src/linux | |
parent | efbe8a7960f5a6f92134fc8b0f4c946a7664a5f0 (diff) |
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"}
Diffstat (limited to 'src/linux')
-rw-r--r-- | src/linux/ogOperations.py | 4 |
1 files changed, 4 insertions, 0 deletions
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') |