aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo/commands/maintdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'MgaRepo/commands/maintdb.py')
-rw-r--r--MgaRepo/commands/maintdb.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/MgaRepo/commands/maintdb.py b/MgaRepo/commands/maintdb.py
index 9a97be8..83621b1 100644
--- a/MgaRepo/commands/maintdb.py
+++ b/MgaRepo/commands/maintdb.py
@@ -32,10 +32,16 @@ def parse_options():
def maintdb(maintdb_args):
host = config.get("maintdb", "host", "maintdb.mageia.org")
- maintdb_helper = get_helper("maintdb")
- cmd_args = ' '.join(maintdb_args)
- command = "ssh %s %s %s" % (host, maintdb_helper, cmd_args)
- execcmd(command, show=True)
+ if (maintdb_args[0] == 'get' and len(maintdb_args)>=2):
+ import urllib.request
+ page=urllib.request.urlopen('http://'+host+'/'+maintdb_args[1])
+ rep = page.read().decode('utf8')
+ print(rep)
+ else:
+ maintdb_helper = get_helper("maintdb")
+ cmd_args = ' '.join(maintdb_args)
+ command = "ssh %s %s %s" % (host, maintdb_helper, cmd_args)
+ execcmd(command, show=True)
sys.exit(0)
def main():