Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make cloner get config from stoneridge config file

  • Loading branch information...
commit ae00eac51febfd935664111bf5c262bba858c8fc 1 parent 9d7d8d0
@todesschaf todesschaf authored
Showing with 8 additions and 13 deletions.
  1. +8 −13 stoneridge_cloner.py
View
21 stoneridge_cloner.py
@@ -32,10 +32,10 @@ class StoneRidgeCloner(object):
web server. Those clients use stoneridge_downloader.py to get the files they
need from the central server.
"""
- def __init__(self, host, path, outdir):
- self.host = host
- self.path = path
- self.outroot = os.path.abspath(outdir)
+ def __init__(self):
+ self.host = stoneridge.get_config('cloner', 'host')
+ self.path = stoneridge.get_config('cloner', 'path')
+ self.outroot = stoneridge.get_config('server', 'downloads')
self.tstamp = time.strftime('%Y%m%d%H%M%S', time.gmtime())
self.outdir = os.path.join(self.outroot, self.tstamp)
self.latest = os.path.join(self.outroot, 'latest')
@@ -198,15 +198,10 @@ def run(self):
@stoneridge.main
def main():
parser = argparse.ArgumentParser()
- parser.add_argument('--host', dest='host', metavar='HOST',
- default='ftp.mozilla.org', help='Host to clone from')
- parser.add_argument('--path', dest='path', metavar='PATH',
- default='/pub/mozilla.org/firefox/nightly/latest-mozilla-central',
- help='Directory on server to clone from')
- parser.add_argument('--output', dest='outdir', metavar='DIR',
- default='.', help='Where to store cloned files to')
-
+ parser.add_argument('--config', dest='config', required=True)
args = parser.parse_args()
- cloner = StoneRidgeCloner(args.host, args.path, args.outdir)
+ stoneridge._conffile = args.config
+
+ cloner = StoneRidgeCloner()
cloner.run()
Please sign in to comment.
Something went wrong with that request. Please try again.