From 3d07394860154f6f8ef7d5aa03c007c0452ecc9f Mon Sep 17 00:00:00 2001 From: Papoteur Date: Wed, 29 Nov 2017 18:24:16 +0100 Subject: allow maintdb get without packagers credentials --- MgaRepo/commands/maintdb.py | 14 ++++++++++---- 1 file 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(): -- cgit v1.2.1