summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-04-07 12:26:32 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-04-07 12:58:54 +0200
commit01ed5a303963153ae81707fe987b40f90a3e726f (patch)
treee0c1eee18a252440220ef440e3927f23751dfc1b /cli/cli.py
parent19e7d98aec75452ffee74b098497ef363ed6c89c (diff)
Add "setup disk" command
Enables sending format and partition commands to the ogServer. Syntax: ogcli setup disk {options} Options are: --type [{dos,gpt}] Disk partition scheme --num [NUM] Disk number (defaults to 1) --format [FORMAT] Indicates which partitions to reformat if they are already present. Use --part alone to mean all partitions. --part PART [PART ...] Partition definition (syntax: "num,part_scheme,fs,size") size is specified as a positive digit followed by a size unit like [MGT] 512M, 50G, 1T, etc. ogcli accepts {LINUX,WINDOWS,EFI,CACHE} as part types and {EXT4, NTFS, FAT32, CACHE} as filesystem types inside the partition definition string 1,LINUX,EXT4,50G => partition 1, of type linux with ext4 fs of 50 GB size If you wanted to add a partition cache (OpenGnsys usually mandates this partition to be number 4) you can omit partitions up to that number and ogcli will fill with EMPTY partitions. So if you define the following parts: --part 1,... --part 4,... ogcli will fill parts 2 and 3 with EMPTY part type and fs. Client selection argument follow previous used options --center-id CENTER_ID --room-id ROOM_ID --client-ip CLIENT_IP
Diffstat (limited to 'cli/cli.py')
-rw-r--r--cli/cli.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 1fa411f..61db374 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -110,3 +110,12 @@ class OgCLI():
if parsed_args.create_obj == 'image':
OgImage.create_image(self.rest, args[1:])
+
+ def setup(self, args):
+ choices = ['disk']
+ parser = argparse.ArgumentParser(prog='ogcli setup')
+ parser.add_argument('setup_obj', choices=choices)
+ parsed_args = parser.parse_args([args[0]])
+
+ if parsed_args.setup_obj == 'disk':
+ OgDisk.setup_disk(self.rest, args[1:])