summaryrefslogtreecommitdiffstats
path: root/src/linux
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2020-01-02 21:37:01 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commitefbe8a7960f5a6f92134fc8b0f4c946a7664a5f0 (patch)
tree4c3f8148315c97979a4f91e6bce792fc0eab3caa /src/linux
parent9fd8f2dbd0bf1edd05eaf94d6a067f5709cfb573 (diff)
Add setup command for configuring the machine
ogAdmClient has a support to configure the machines. This new command allows the new ogClient to execute the same script to configure the machine. The json format sent from the server must be: { "disk" : "1", "cache" : "0", "cache_size" : "70000000",\ "partition_setup": [{"partition": "1", "code": "NTFS", "filesystem": "NTFS",\ "size": "11000000", "format": "0"}]}
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/ogOperations.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index 85c8c0a..bbc3b1a 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -35,3 +35,8 @@ def procsoftware(disk, partition, path):
def prochardware(path):
result = subprocess.check_output([OG_PATH + 'interfaceAdm/InventarioHardware', path], shell=True)
return result.decode('utf-8')
+
+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)