Commits

Ian Bicking committed ec01ffd Merge

merge

  • Participants
  • Parent commits 3bf65c2, 317c92c

Comments (0)

Files changed (5)

File silverlining/commands/run.py

         tmp_location = match.group(1)
     else:
         tmp_location = 'NONE'
+    ssh_args = ['-t'] if args.interactive else []
     stdout, stderr, returncode = ssh(
         args.user, config.node_hostname,
         ['/usr/local/share/silverlining/mgr-scripts/run-command.py',
-         args.location, tmp_location, args.script] + translated_args)
+         args.location, tmp_location, args.script] + translated_args,
+        ssh_args=ssh_args)
     return returncode

File silverlining/commands/setup_node.py

                         if line.strip() and not line.strip().startswith('#'))
     stdout, stderr, returncode = ssh(
         'root', node, """DEBCONF_DB_OVERRIDE='File{/root/config.dat}' """ + \
-                      """apt-get -y -q=2 install $(cat)""",
+                      """apt-get -y -q=2 install --no-install-recommends $(cat)""",
         stdin=packages)
     if returncode:
         config.logger.fatal(

File silverlining/commands/update.py

     else:
         clear_option = ''
     ssh('root', config.node_hostname,
+        'find /var/www/%(instance_name)s -name "*.pyc" -delete; '
         'python -m compileall -q /var/www/%(instance_name)s; '
         '/usr/local/share/silverlining/mgr-scripts/update-service.py %(instance_name)s %(clear_option)s'
         % dict(instance_name=instance_name,
                location=config.args.location),
         )
 
-    ip = socket.gethostbyname(config.node_hostname)
-    hostname = appdata.normalize_location(config.args.location)[0]
-    set_etc_hosts(config, [hostname,
-                           'prev.' + hostname], ip)
+    if config.args.update_etc_hosts:
+        ip = socket.gethostbyname(config.node_hostname)
+        hostname = appdata.normalize_location(config.args.location)[0]
+        set_etc_hosts(config, [hostname,
+                               'prev.' + hostname], ip)
 
 def check_config_in_subprocess(app, config, logger):
     logger.notify('Checking configuration.')

File silverlining/runner.py

     metavar='CONFIG_DIR',
     help="Configuration to use for this deployment of the application")
 
+parser_update.add_argument(
+    '--noetchosts', help="Do not try to update /etc/hosts",
+    dest='update_etc_hosts', action='store_const', const=False, default=True)
+
 parser_init = subcommands.add_parser(
     'init', help="Create a new application file layout")
 
     action='store_true',
     help="Answer yes to any questions")
 
+parser_run.add_argument(
+    '-i', '--interactive',
+    action='store_true',
+    help=("Tells ssh to force pseudo-tty allocation.  Useful when what you're"
+          " running is a shell of some sort"))
+
 #add_verbose(parser_run, add_log=True)
 
 parser_run.add_argument(

File silversupport/shell.py

 
 def apt_install(packages, **kw):
     """Install the given list of packages"""
-    return run(['apt-get', 'install', '-q=2', '-y', '--force-yes'] + packages, **kw)
+    return run(['apt-get', 'install', '-q=2', '-y', '--force-yes',
+                '--no-install-recommends'] + packages, **kw)
 
 
 _end_quote_re = re.compile(r"^('*)(.*?)('*)$", re.S)