qwertyface avatar qwertyface committed ea4f736

Make updating /etc/hosts optional

Comments (0)

Files changed (2)

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.')

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")
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.