aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2017-11-29 18:24:16 +0100
committerPapoteur <papoteur@mageia.org>2017-11-29 18:24:16 +0100
commit3d07394860154f6f8ef7d5aa03c007c0452ecc9f (patch)
tree025e23ce7595bf4297b0385350c818dcc7305d2e /MgaRepo
parent5cba5daa64dd8591c39bd55b54fb4c9536dcd54b (diff)
downloadmgarepo-3d07394860154f6f8ef7d5aa03c007c0452ecc9f.tar
mgarepo-3d07394860154f6f8ef7d5aa03c007c0452ecc9f.tar.gz
mgarepo-3d07394860154f6f8ef7d5aa03c007c0452ecc9f.tar.bz2
mgarepo-3d07394860154f6f8ef7d5aa03c007c0452ecc9f.tar.xz
mgarepo-3d07394860154f6f8ef7d5aa03c007c0452ecc9f.zip
allow maintdb get <package> without packagers credentials
Diffstat (limited to 'MgaRepo')
-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():