remove "twisted" configuration (closes #2919310)

This was also known as "web only" instances. Not used in production anywhere today.

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changesete4d753c8b1c4
branchdefault
phasepublic
hiddenno
parent revision#0dcc68dd8458 merge 3.17.8 into default
child revision#01bca75ee8bd [devtools,etwist] rename TwistedConfiguration to WebConfigurationBase (follows #2919310)
files modified by this revision
cwconfig.py
cwctl.py
etwist/twconfig.py
test/data/migration/0.1.0_web.py
test/unittest_migration.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1373619095 -7200
# Fri Jul 12 10:51:35 2013 +0200
# Node ID e4d753c8b1c4d9afdc160e1a067346f9d5738774
# Parent 0dcc68dd8458f0ae236108400bc73796ea4c9648
remove "twisted" configuration (closes #2919310)

This was also known as "web only" instances. Not used in production anywhere today.

diff --git a/cwconfig.py b/cwconfig.py
@@ -204,11 +204,11 @@
1 
2  def possible_configurations(directory):
3      """return a list of installed configurations in a directory
4      according to \*-ctl files
5      """
6 -    return [name for name in ('repository', 'twisted', 'all-in-one')
7 +    return [name for name in ('repository', 'all-in-one')
8              if exists(join(directory, '%s.conf' % name))]
9 
10  def guess_configuration(directory):
11      """try to guess the configuration to use for a directory. If multiple
12      configurations are found, ConfigurationError is raised
@@ -938,14 +938,13 @@
13          if not exists(home):
14              raise ConfigurationError('no such instance %s (check it exists with'
15                                       ' "cubicweb-ctl list")' % appid)
16          return home
17 
18 -    MODES = ('common', 'repository', 'Any', 'web')
19 +    MODES = ('common', 'repository', 'Any')
20      MCOMPAT = {'all-in-one': MODES,
21 -               'repository': ('common', 'repository', 'Any'),
22 -               'twisted'   : ('common', 'web'),}
23 +               'repository': ('common', 'repository', 'Any')}
24      @classmethod
25      def accept_mode(cls, mode):
26          #assert mode in cls.MODES, mode
27          return mode in cls.MCOMPAT[cls.name]
28 
diff --git a/cwctl.py b/cwctl.py
@@ -355,11 +355,11 @@
29            'help': 'configuration level (0..2): 0 will ask for essential '
30            'configuration parameters only while 2 will ask for all parameters',
31            }),
32          ('config',
33           {'short': 'c', 'type' : 'choice', 'metavar': '<install type>',
34 -          'choices': ('all-in-one', 'repository', 'twisted'),
35 +          'choices': ('all-in-one', 'repository'),
36            'default': 'all-in-one',
37            'help': 'installation type, telling which part of an instance '
38            'should be installed. You can list available configurations using the'
39            ' "list" command. Default to "all-in-one", e.g. an installation '
40            'embedding both the RQL repository and the web server.',
diff --git a/etwist/twconfig.py b/etwist/twconfig.py
@@ -34,11 +34,10 @@
41  from cubicweb.web.webconfig import WebConfiguration
42 
43 
44  class TwistedConfiguration(WebConfiguration):
45      """web instance (in a twisted web server) client of a RQL server"""
46 -    name = 'twisted'
47 
48      options = merge_options((
49          # ctl configuration
50          ('port',
51           {'type' : 'int',
@@ -105,12 +104,10 @@
52      def default_base_url(self):
53          from socket import getfqdn
54          return 'http://%s:%s/' % (self['host'] or getfqdn(), self['port'] or 8080)
55 
56 
57 -CONFIGURATIONS.append(TwistedConfiguration)
58 -
59  try:
60      from cubicweb.server.serverconfig import ServerConfiguration
61 
62      class AllInOneConfiguration(TwistedConfiguration, ServerConfiguration):
63          """repository and web instance in the same twisted process"""
diff --git a/test/data/migration/0.1.0_web.py b/test/data/migration/0.1.0_web.py
@@ -1,20 +0,0 @@
64 -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
65 -# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
66 -#
67 -# This file is part of CubicWeb.
68 -#
69 -# CubicWeb is free software: you can redistribute it and/or modify it under the
70 -# terms of the GNU Lesser General Public License as published by the Free
71 -# Software Foundation, either version 2.1 of the License, or (at your option)
72 -# any later version.
73 -#
74 -# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
75 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
76 -# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
77 -# details.
78 -#
79 -# You should have received a copy of the GNU Lesser General Public License along
80 -# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
81 -"""web only
82 -
83 -"""
diff --git a/test/unittest_migration.py b/test/unittest_migration.py
@@ -77,25 +77,20 @@
84          config = CubicWebConfiguration('data')
85          config.verbosity = 0
86          self.assert_(not isinstance(config.migration_handler(), ServerMigrationHelper))
87          self.assertIsInstance(config.migration_handler(), MigrationHelper)
88          config = self.config
89 -        config.__class__.name = 'twisted'
90 -        self.assertListEqual(filter_scripts(config, TMIGRDIR, (0,0,4), (0,1,0)),
91 -                              [((0, 1 ,0), TMIGRDIR+'0.1.0_common.py'),
92 -                               ((0, 1 ,0), TMIGRDIR+'0.1.0_web.py')])
93          config.__class__.name = 'repository'
94          self.assertListEqual(filter_scripts(config, TMIGRDIR, (0,0,4), (0,1,0)),
95                                [((0, 1 ,0), TMIGRDIR+'0.1.0_Any.py'),
96                                 ((0, 1 ,0), TMIGRDIR+'0.1.0_common.py'),
97                                 ((0, 1 ,0), TMIGRDIR+'0.1.0_repository.py')])
98          config.__class__.name = 'all-in-one'
99          self.assertListEqual(filter_scripts(config, TMIGRDIR, (0,0,4), (0,1,0)),
100                                [((0, 1 ,0), TMIGRDIR+'0.1.0_Any.py'),
101                                 ((0, 1 ,0), TMIGRDIR+'0.1.0_common.py'),
102 -                               ((0, 1 ,0), TMIGRDIR+'0.1.0_repository.py'),
103 -                               ((0, 1 ,0), TMIGRDIR+'0.1.0_web.py')])
104 +                               ((0, 1 ,0), TMIGRDIR+'0.1.0_repository.py')])
105          config.__class__.name = 'repository'
106 
107 
108  from cubicweb.devtools import ApptestConfiguration, get_test_db_handler
109