Skip to content
This repository
Browse code

Make cloner get config from stoneridge config file

  • Loading branch information...
commit ae00eac51febfd935664111bf5c262bba858c8fc 1 parent 9d7d8d0
Nicholas Hurley authored

Showing 1 changed file with 8 additions and 13 deletions. Show diff stats Hide diff stats

  1. 21  stoneridge_cloner.py
21  stoneridge_cloner.py
@@ -32,10 +32,10 @@ class StoneRidgeCloner(object):
32 32
     web server. Those clients use stoneridge_downloader.py to get the files they
33 33
     need from the central server.
34 34
     """
35  
-    def __init__(self, host, path, outdir):
36  
-        self.host = host
37  
-        self.path = path
38  
-        self.outroot = os.path.abspath(outdir)
  35
+    def __init__(self):
  36
+        self.host = stoneridge.get_config('cloner', 'host')
  37
+        self.path = stoneridge.get_config('cloner', 'path')
  38
+        self.outroot = stoneridge.get_config('server', 'downloads')
39 39
         self.tstamp = time.strftime('%Y%m%d%H%M%S', time.gmtime())
40 40
         self.outdir = os.path.join(self.outroot, self.tstamp)
41 41
         self.latest = os.path.join(self.outroot, 'latest')
@@ -198,15 +198,10 @@ def run(self):
198 198
 @stoneridge.main
199 199
 def main():
200 200
     parser = argparse.ArgumentParser()
201  
-    parser.add_argument('--host', dest='host', metavar='HOST',
202  
-            default='ftp.mozilla.org', help='Host to clone from')
203  
-    parser.add_argument('--path', dest='path', metavar='PATH',
204  
-            default='/pub/mozilla.org/firefox/nightly/latest-mozilla-central',
205  
-            help='Directory on server to clone from')
206  
-    parser.add_argument('--output', dest='outdir', metavar='DIR',
207  
-            default='.', help='Where to store cloned files to')
208  
-
  201
+    parser.add_argument('--config', dest='config', required=True)
209 202
     args = parser.parse_args()
210 203
 
211  
-    cloner = StoneRidgeCloner(args.host, args.path, args.outdir)
  204
+    stoneridge._conffile = args.config
  205
+
  206
+    cloner = StoneRidgeCloner()
212 207
     cloner.run()

0 notes on commit ae00eac

Please sign in to comment.
Something went wrong with that request. Please try again.