Commits

Ian Bicking committed ef52857 Merge

merge

  • Participants
  • Parent commits 8da0409, 5c881ed

Comments (0)

Files changed (4)

silverlining/commands/serve.py

     environ = os.environ.copy()
     environ['SILVER_INSTANCE_NAME'] = 'localhost'
     environ['SILVER_PASTE_LOCATION'] = httpserver.__file__
+    environ['SILVER_SERVE_HOST'] = config.args.host
+    environ['SILVER_SERVE_PORT'] = config.args.port
     proc = None
     try:
         try:

silverlining/commands/setup_node.py

 apt-get update -qq
 apt-get -y -q=2 install rsync
 ''')
+    config.logger.notify(
+        "Updating postfix configuration")
     stdout, stderr, returncode = ssh(
     'root', node, '''
-cat >> /root/config.dat <<EOF
+echo "
 Name: postfix/mailname
 Template: postfix/mailname
-Value: straylight.bel-epa.com
+Value: %s
 Owners: postfix
 Flags: seen
 
 Value: Internet site
 Owners: postfix
 Flags: seen
-EOF 
-''')
+" >> /root/config.dat
+''' % node)
     if returncode:
         config.logger.fatal(
             "An error occurred (code=%r)"
                         for line in lines
                         if line.strip() and not line.strip().startswith('#'))
     stdout, stderr, returncode = ssh(
-        'root', node, """DEBCONF_DB_OVERRIDE='File{/root/config.dat} """ + \
+        'root', node, """DEBCONF_DB_OVERRIDE='File{/root/config.dat}' """ + \
                       """apt-get -y -q=2 install $(cat)""",
         stdin=packages)
     if returncode:

silverlining/devel-runner.py

 def main(base_path):
     app = CompoundApp(base_path)
     httpserver = load_paste_httpserver()
+    host = os.environ.get('SILVER_SERVE_HOST', '127.0.0.1')
+    port = os.environ.get('SILVER_SERVE_PORT', '8080')
     try:
-        httpserver.serve(app)
+        httpserver.serve(app, host=host, port=port)
     except KeyboardInterrupt:
         pass
 

silverlining/runner.py

     metavar='APP_DIR',
     help='Directory holding app')
 
+parser_serve.add_argument(
+    '--port',
+    metavar='PORT',
+    default='8080',
+    help='Port to serve on (default 8080)')
+    
+parser_serve.add_argument(
+    '--host',
+    metavar='IP/INTERFACE',
+    default='127.0.0.1',
+    help='Host/IP/interface to serve on (127.0.0.1 is private, 0.0.0.0 is public)')
+
 ## We can't handle "silver run" well with a subparser, because there's
 ## a bug in subparsers that they can't ignore arguments they don't
 ## understand.  Because there will be arguments passed to the remote