From 63b1a7485c47d0e4f6d7d5e533bff4fe6914092d Mon Sep 17 00:00:00 2001 From: David Glick Date: Sun, 28 Oct 2018 13:53:06 -0400 Subject: [PATCH] Back to explicit option --- CHANGES.rst | 5 ----- src/plone/recipe/zope2instance/recipe.py | 10 ++++------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index dac2ceaa..6ab342c8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,11 +6,6 @@ Changelog Breaking changes: -- Determine whether to set up a WSGI-based instanced - automatically based on whether ZServer is included in the eggs, - instead of explicitly using the ``wsgi`` option. - [davisagli] - - For WSGI-based instances, generate a zdaemon-based instance script that works similarly to ZServer-based instances, instead of a script that only handles running the WSGI server. diff --git a/src/plone/recipe/zope2instance/recipe.py b/src/plone/recipe/zope2instance/recipe.py index ef57cc8a..5fa080eb 100644 --- a/src/plone/recipe/zope2instance/recipe.py +++ b/src/plone/recipe/zope2instance/recipe.py @@ -77,6 +77,7 @@ def __init__(self, buildout, name, options): buildout['buildout'].get('include-site-packages', 'false') ) not in ('off', 'disable', 'false') + self.wsgi = options.get('wsgi') in ('on', 'waitress') # Get Scripts' attributes return Scripts.__init__(self, buildout, name, options) @@ -95,10 +96,6 @@ def install(self, update=False): make.make_instance(options.get('user', None), location, version) try: - requirements, ws = self.egg.working_set( - ['plone.recipe.zope2instance']) - self.wsgi = 'zserver' not in ws.by_key - # Make a new zope.conf and wsgi.ini # based on options in buildout.cfg self.build_zope_conf() @@ -106,7 +103,7 @@ def install(self, update=False): self.build_wsgi_ini() # Install extra scripts - installed.extend(self.install_scripts(ws)) + installed.extend(self.install_scripts()) # Add zcml files to package-includes self.build_package_includes() @@ -609,7 +606,7 @@ def build_wsgi_ini(self): with open(wsgi_ini_path, 'w') as f: f.write(wsgi_ini) - def install_scripts(self, ws): + def install_scripts(self): options = self.options location = options['location'] @@ -622,6 +619,7 @@ def install_scripts(self, ws): zopectl_umask = options.get('zopectl-umask', '') extra_paths = options.get('extra-paths', '').split() + requirements, ws = self.egg.working_set(['plone.recipe.zope2instance']) reqs = [self.options.get('control-script', self.name)] reqs.extend(['plone.recipe.zope2instance.ctl', 'main']) reqs = [tuple(reqs)]