summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-11-07 16:26:55 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-11-21 17:05:26 +0100
commit85d910d0203370311ef3eba134dafbc49bd46ac1 (patch)
treebf49860ab61dfdc832de8b6f50f3e0e49cdfd95e /cli/cli.py
parentc4eb5d165a00fbe7e5ec2e9a1e7f2123ce09bcd5 (diff)
cli: add live management commandsHEADmaster
Add new parameters to the config file ogcli.json with the following default values: 'local_live': '/var/www/html/ogrelive' 'server_live': 'https://opengnsys.soleta.eu/ogrelive' Add command to install the files of a live system. Example: ogcli install live --name ogrelive-6.1.0-26 Perform an update if live files are already present. Add command to delete the files of a live system. Example: ogcli delete live --name ogrelive-6.1.0-26 Update ogcli list live to show the lives in the server when invoked with the --remote flag. Example: ogcli list live --remote
Diffstat (limited to 'cli/cli.py')
-rw-r--r--cli/cli.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 3d49791..2fdabf0 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -113,7 +113,7 @@ class OgCLI():
elif parsed_args.item == 'servers':
ret = OgServer.list_servers(self.rest)
elif parsed_args.item == 'live':
- ret = OgLive.list_live(self.rest)
+ ret = OgLive.list_live(self.rest, args[1:])
return ret
def set(self, args):
@@ -231,7 +231,7 @@ class OgCLI():
return ret
def delete(self, args):
- choices = ['server', 'repo', 'center', 'room', 'client', 'folder']
+ choices = ['server', 'repo', 'center', 'room', 'client', 'folder', 'live']
parser = argparse.ArgumentParser(prog='ogcli delete')
parser.add_argument('delete_obj', choices=choices)
@@ -253,6 +253,8 @@ class OgCLI():
ret = OgClient.delete_client(self.rest, args[1:])
elif parsed_args.delete_obj == 'folder':
ret = OgFolder.delete_folder(self.rest, args[1:])
+ elif parsed_args.delete_obj == 'live':
+ ret = OgLive.delete_live(self.rest, args[1:])
return ret
def add(self, args):
@@ -280,3 +282,19 @@ class OgCLI():
elif parsed_args.add_obj == 'folder':
ret = OgFolder.add_folder(self.rest, args[1:])
return ret
+
+ def install(self, args):
+ choices = ['live']
+ parser = argparse.ArgumentParser(prog='ogcli install')
+ parser.add_argument('install_obj', choices=choices)
+
+ if not args:
+ print('Missing install subcommand', file=sys.stderr)
+ parser.print_help(file=sys.stderr)
+ return 1
+
+ parsed_args = parser.parse_args([args[0]])
+ ret = 0
+ if parsed_args.install_obj == 'live':
+ ret = OgLive.install_live(self.rest, args[1:])
+ return ret