def reload_(environment, opts):
if opts['<STR_LIT>']:<EOL><INDENT>opts['<STR_LIT>'] = True<EOL><DEDENT>if opts['<STR_LIT>'] and is_boot2docker():<EOL><INDENT>raise DatacatsError('<STR_LIT>')<EOL><DEDENT>environment.require_data()<EOL>environment.stop_ckan()<EOL>if opts['<STR_LIT>'] or opts['<STR_LIT>'] or opts['<STR_LIT>']:<EOL><INDENT>if opts['<STR_LIT>']:<EOL><INDENT>environment.port = int(opts['<STR_LIT>'])<EOL><DEDENT>if opts['<STR_LIT>']:<EOL><INDENT>environment.address = opts['<STR_LIT>']<EOL><DEDENT>if opts['<STR_LIT>']:<EOL><INDENT>site_url = opts['<STR_LIT>']<EOL>try:<EOL><INDENT>site_url = site_url.format(address=environment.address, port=environment.port)<EOL>environment.site_url = site_url<EOL>environment.save_site(False)<EOL><DEDENT>except (KeyError, IndexError, ValueError) as e:<EOL><INDENT>raise DatacatsError('<STR_LIT>'.format(e))<EOL><DEDENT><DEDENT>environment.save()<EOL><DEDENT>for container in environment.extra_containers:<EOL><INDENT>require_extra_image(EXTRA_IMAGE_MAPPING[container])<EOL><DEDENT>environment.stop_supporting_containers()<EOL>environment.start_supporting_containers()<EOL>environment.start_ckan(<EOL>production=opts['<STR_LIT>'],<EOL>paster_reload=not opts['<STR_LIT>'],<EOL>log_syslog=opts['<STR_LIT>'],<EOL>interactive=opts['<STR_LIT>'])<EOL>write('<STR_LIT>'.format(environment.web_address()))<EOL>if opts['<STR_LIT>']:<EOL><INDENT>write('<STR_LIT:\n>')<EOL>return<EOL><DEDENT>try:<EOL><INDENT>environment.wait_for_web_available()<EOL><DEDENT>finally:<EOL><INDENT>write('<STR_LIT:\n>')<EOL><DEDENT>
Reload environment source and configuration

Usage:
  datacats reload [-b] [-p|--no-watch] [--syslog] [-s NAME] [--site-url=SITE_URL]
                            [-i] [--address=IP] [ENVIRONMENT [PORT]]
  datacats reload -r [-b] [--syslog] [-s NAME] [--address=IP] [--site-url=SITE_URL]
                            [-i] [ENVIRONMENT]

Options:
  --address=IP          Address to listen on (Linux-only)
  -i --interactive      Calls out to docker via the command line, allowing
                        for interactivity with the web image.
  --site-url=SITE_URL   The site_url to use in API responses. Can use Python template syntax
                        to insert the port and address (e.g. http://example.org:{port}/)
  -b --background       Don't wait for response from web server
  --no-watch            Do not automatically reload templates and .py files on change
  -p --production       Reload with apache and debug=false
  -s --site=NAME        Specify a site to reload [default: primary]
  --syslog              Log to the syslog

ENVIRONMENT may be an environment name or a path to an environment directory.
Default: '.'