Commits

qwertyface  committed ea4f736

Make updating /etc/hosts optional

  • Participants
  • Parent commits 8597f52

Comments (0)

Files changed (2)

File silverlining/commands/update.py

                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")