Remove remote repository-access-through-pyro support

Modern methods such as the rqlcontroller cube + the cwclientlib library are the way forward.

Closes #2919309.

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changeset684215aca046
branchdefault
phasepublic
hiddenno
parent revision#cda1bdc3652e [web] split timeline in an individual cube
child revision#ef3059a692cb Remove the remote repository-access-through-zmq support
files modified by this revision
cwctl.py
dbapi.py
debian/control
debian/cubicweb-ctl.cubicweb.init
devtools/__init__.py
devtools/httptest.py
doc/3.21.rst
doc/book/en/admin/config.rst
doc/book/en/admin/index.rst
doc/book/en/admin/instance-config.rst
doc/book/en/admin/migration.rst
doc/book/en/admin/pyro.rst
doc/features_list.rst
etwist/server.py
etwist/twconfig.py
repoapi.py
server/cwzmq.py
server/repository.py
server/server.py
server/serverconfig.py
server/serverctl.py
server/test/unittest_repository.py
server/test/unittest_tools.py
test/unittest_utils.py
transaction.py
utils.py
web/webctl.py
zmqclient.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1425391054 -3600
# Tue Mar 03 14:57:34 2015 +0100
# Node ID 684215aca046b3b458e4cadc6b337f4a79a2dc12
# Parent cda1bdc3652e8ab3e6ab8f51308abfe3dbc3f901
Remove remote repository-access-through-pyro support

Modern methods such as the rqlcontroller cube + the cwclientlib
library are the way forward.

Closes #2919309.

diff --git a/cwctl.py b/cwctl.py
@@ -1,6 +1,6 @@
1 -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2 +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
3  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
4  #
5  # This file is part of CubicWeb.
6  #
7  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -399,11 +399,11 @@
8          if not self.config.automatic:
9              sections = set(sect.lower() for sect, opt, odict in config.all_options()
10                             if 'type' in odict
11                             and odict.get('level') <= self.config.config_level)
12              for section in sections:
13 -                if section not in ('main', 'email', 'pyro', 'web'):
14 +                if section not in ('main', 'email', 'web'):
15                      print '\n' + underline_title('%s options' % section)
16                      config.input_config(section, self.config.config_level)
17          # write down configuration
18          config.save()
19          self._handle_win32(config, appid)
@@ -898,13 +898,11 @@
20            }),
21 
22          ('repo-uri',
23           {'short': 'H', 'type' : 'string', 'metavar': '<protocol>://<[host][:port]>',
24            'help': 'URI of the CubicWeb repository to connect to. URI can be \
25 -pyro://[host:port] the Pyro name server host; if the pyro nameserver is not set, \
26 -it will be detected by using a broadcast query, a ZMQ URL or \
27 -inmemory:// (default) use an in-memory repository. THIS OPTION IS DEPRECATED, \
28 +a ZMQ URL or inmemory:// (default) use an in-memory repository. THIS OPTION IS DEPRECATED, \
29  directly give URI as instance id instead',
30            'group': 'remote'
31            }),
32          )
33 
@@ -951,11 +949,11 @@
34      def run(self, args):
35          appuri = args.pop(0)
36          if self.config.repo_uri:
37              warn('[3.16] --repo-uri option is deprecated, directly give the URI as instance id',
38                   DeprecationWarning)
39 -            if urlparse(self.config.repo_uri).scheme in ('pyro', 'inmemory'):
40 +            if urlparse(self.config.repo_uri).scheme == 'inmemory':
41                  appuri = '%s/%s' % (self.config.repo_uri.rstrip('/'), appuri)
42 
43          from cubicweb.utils import parse_repo_uri
44          protocol, hostport, appid = parse_repo_uri(appuri)
45          if protocol == 'inmemory':
diff --git a/dbapi.py b/dbapi.py
@@ -117,17 +117,11 @@
46      `database` may be:
47 
48      * a simple instance id for in-memory connection
49 
50      * a uri like scheme://host:port/instanceid where scheme may be one of
51 -      'pyro', 'inmemory' or 'zmqpickle'
52 -
53 -      * if scheme is 'pyro', <host:port> determine the name server address. If
54 -        not specified (e.g. 'pyro:///instanceid'), it will be detected through a
55 -        broadcast query. The instance id is the name of the instance in the name
56 -        server and may be prefixed by a group (e.g.
57 -        'pyro:///:cubicweb.instanceid')
58 +      'inmemory' or 'zmqpickle'
59 
60        * if scheme is handled by ZMQ (eg 'tcp'), you should not specify an
61          instance id
62 
63      Other arguments:
@@ -135,12 +129,11 @@
64      :login:
65        the user login to use to authenticate.
66 
67      :cnxprops:
68        a :class:`ConnectionProperties` instance, allowing to specify
69 -      the connection method (eg in memory or pyro). A Pyro connection will be
70 -      established if you don't specify that argument.
71 +      the connection method (eg in memory or zmq).
72 
73      :setvreg:
74        flag telling if a registry should be initialized for the connection.
75        Don't change this unless you know what you're doing.
76 
@@ -164,18 +157,10 @@
77               DeprecationWarning, stacklevel=2)
78          if cnxprops and cnxprops.cnxtype == 'zmq':
79              database = kwargs.pop('host')
80          elif cnxprops and cnxprops.cnxtype == 'inmemory':
81              database = 'inmemory://' + database
82 -        else:
83 -            host = kwargs.pop('host', None)
84 -            if host is None:
85 -                host = ''
86 -            group = kwargs.pop('group', None)
87 -            if group is None:
88 -                group = 'cubicweb'
89 -            database = 'pyro://%s/%s.%s' % (host, group, database)
90      puri = urlparse(database)
91      method = puri.scheme.lower()
92      if method == 'inmemory':
93          config = cwconfig.instance_configuration(puri.netloc)
94      else:
@@ -733,14 +718,10 @@
95          self._repo.rollback(self.sessionid, **self._txid())
96 
97      @check_not_closed
98      def cursor(self, req=None):
99          """Return a new Cursor Object using the connection.
100 -
101 -        On pyro connection, you should get cursor after calling if
102 -        load_appobjects method if desired (which you should call if you intend
103 -        to use ORM abilities).
104          """
105          if req is None:
106              req = self.request()
107          return self.cursor_class(self, self._repo, req=req)
108 
diff --git a/debian/control b/debian/control
@@ -56,11 +56,10 @@
109   cubicweb-postgresql-support
110   | cubicweb-mysql-support
111   | python-pysqlite2,
112   python-passlib
113  Recommends:
114 - pyro (<< 4.0.0),
115   cubicweb-documentation (= ${source:Version})
116  Suggests:
117   python-zmq
118  Description: server part of the CubicWeb framework
119   CubicWeb is a semantic web application framework.
@@ -107,11 +106,10 @@
120   ${python:Depends},
121   cubicweb-web (= ${source:Version}),
122   cubicweb-ctl (= ${source:Version}),
123   python-twisted-web
124  Recommends:
125 - pyro (<< 4.0.0),
126   cubicweb-documentation (= ${source:Version})
127  Description: twisted-based web interface for the CubicWeb framework
128   CubicWeb is a semantic web application framework.
129   .
130   This package provides a twisted based HTTP server to serve
diff --git a/debian/cubicweb-ctl.cubicweb.init b/debian/cubicweb-ctl.cubicweb.init
@@ -2,20 +2,18 @@
131 
132  ### BEGIN INIT INFO
133  # Provides:          cubicweb
134  # Required-Start:    $remote_fs $syslog $local_fs $network
135  # Required-Stop:     $remote_fs $syslog $local_fs $network
136 -# Should-Start:      postgresql pyro-nsd
137 -# Should-Stop:       postgresql pyro-nsd
138 +# Should-Start:      postgresql
139 +# Should-Stop:       postgresql
140  # Default-Start:     2 3 4 5
141  # Default-Stop:      0 1 6
142  # Short-Description: Start cubicweb application at boot time
143  ### END INIT INFO
144 
145  # FIXME Seems to be inadequate here
146 -# FIXME If related to pyro, try instead:
147 -# export PYRO_STORAGE="/tmp"
148  cd /tmp
149 
150  # FIXME Work-around about the following lintian error
151  #     E: cubicweb-ctl: init.d-script-does-not-implement-required-option /etc/init.d/cubicweb start
152  #
diff --git a/devtools/__init__.py b/devtools/__init__.py
@@ -235,14 +235,10 @@
153      cube_appobject_path = TestServerConfiguration.cube_appobject_path | WebConfigurationBase.cube_appobject_path
154 
155      def available_languages(self, *args):
156          return self.cw_languages()
157 
158 -    def pyro_enabled(self):
159 -        # but export PYRO_MULTITHREAD=0 or you get problems with sqlite and
160 -        # threads
161 -        return True
162 
163  # XXX merge with BaseApptestConfiguration ?
164  class ApptestConfiguration(BaseApptestConfiguration):
165      # `skip_db_create_and_restore` controls wether or not the test database
166      # should be created / backuped / restored. If set to True, those
diff --git a/devtools/httptest.py b/devtools/httptest.py
@@ -1,6 +1,6 @@
167 -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
168 +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
169  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
170  #
171  # This file is part of CubicWeb.
172  #
173  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -76,12 +76,10 @@
174      def default_base_url(self):
175          port = self['port'] or get_available_port(self.ports_range)
176          self.global_set_option('port', port) # force rewrite here
177          return 'http://127.0.0.1:%d/' % self['port']
178 
179 -    def pyro_enabled(self):
180 -        return False
181 
182 
183  class CubicWebServerTC(CubicWebTC):
184      """Class for running test web server. See :class:`CubicWebServerConfig`.
185 
diff --git a/doc/3.21.rst b/doc/3.21.rst
@@ -12,5 +12,9 @@
186  Deprecated code drops
187  ---------------------
188 
189  * the user_callback api has been removed; people should use plain
190    ajax functions instead
191 +
192 +* the Pyro remote repository access method has been entirely removed
193 +  (emerging alternatives such as rqlcontroller and cwclientlib should
194 +  be used instead)
diff --git a/doc/book/en/admin/config.rst b/doc/book/en/admin/config.rst
@@ -12,19 +12,17 @@
195    - `SQLServer configuration`_
196    - `SQLite configuration`_
197 
198  For advanced features, have a look to:
199 
200 -  - `Pyro configuration`_
201    - `Cubicweb resources configuration`_
202 
203  .. _`configure the database`: DatabaseInstallation_
204  .. _`PostgreSQL configuration`: PostgresqlConfiguration_
205  .. _`MySql configuration`: MySqlConfiguration_
206  .. _`SQLServer configuration`: SQLServerConfiguration_
207  .. _`SQLite configuration`: SQLiteConfiguration_
208 -.. _`Pyro configuration`: PyroConfiguration_
209  .. _`Cubicweb resources configuration`: RessourcesConfiguration_
210 
211 
212 
213  .. _RessourcesConfiguration:
@@ -227,31 +225,5 @@
214 
215  .. Note::
216    SQLite is great for testing and to play with cubicweb but is not suited for
217    production environments.
218 
219 -
220 -.. _PyroConfiguration:
221 -
222 -Pyro configuration
223 -------------------
224 -
225 -Pyro name server
226 -~~~~~~~~~~~~~~~~
227 -
228 -If you want to use Pyro to access your instance remotely, or to have multi-source
229 -or distributed configuration, it is required to have a Pyro name server running
230 -on your network. By default it is detected by a broadcast request, but you can
231 -specify a location in the instance's configuration file.
232 -
233 -To do so, you need to :
234 -
235 -* be sure to have installed it (see :ref:`InstallDependencies`)
236 -
237 -* launch the pyro name server with `pyro-nsd start` before starting cubicweb
238 -
239 -* under debian, edit the file :file:`/etc/default/pyro-nsd` so that the name
240 -  server pyro will be launched automatically when the machine fire up
241 -
242 -Note that you can use the pyro server without a running pyro nameserver.
243 -Refer to `pyro-ns-host` server configuration option for details.
244 -
diff --git a/doc/book/en/admin/index.rst b/doc/book/en/admin/index.rst
@@ -20,10 +20,9 @@
245     create-instance
246     instance-config
247     site-config
248     multisources
249     ldap
250 -   pyro
251     migration
252     additional-tips
253     rql-logs
254 
diff --git a/doc/book/en/admin/instance-config.rst b/doc/book/en/admin/instance-config.rst
@@ -108,36 +108,10 @@
255      timeout of a RQL session
256  :`main.query-log-file`:
257      file where all requests RQL executed by the server are written
258 
259 
260 -Pyro configuration for the instance
261 ------------------------------------
262 -Web server side:
263 -
264 -:`pyro.pyro-instance-id`:
265 -    pyro identifier of RQL server (e.g. the instance name)
266 -
267 -RQL server side:
268 -
269 -:`main.pyro-server`:
270 -    boolean to switch on/off pyro server-side
271 -
272 -:`pyro.pyro-host`:
273 -    pyro host:port number. If no port is specified, it is assigned
274 -    automatically.
275 -
276 -RQL and web servers side:
277 -
278 -:`pyro.pyro-ns-host`:
279 -    hostname hosting pyro server name. If no value is
280 -    specified, it is located by a request from broadcast
281 -
282 -:`pyro.pyro-ns-group`:
283 -    pyro group in which to save the instance (will default to 'cubicweb')
284 -
285 -
286  Configuring e-mail
287  ------------------
288  RQL and web server side:
289 
290  :`email.mangle-mails [no]`:
diff --git a/doc/book/en/admin/migration.rst b/doc/book/en/admin/migration.rst
@@ -6,11 +6,11 @@
291  Migrate apache & cubicweb
292  -------------------------
293 
294  **Aim** : do the migration for N cubicweb instances hosted on a server to another with no downtime.
295 
296 -**Prerequisites** : have an explicit definition of the database host (not default or localhost). In our case, the database is hosted on another host. You are not migrating your pyro server. You are not using multisource (more documentation on that soon).
297 +**Prerequisites** : have an explicit definition of the database host (not default or localhost). In our case, the database is hosted on another host.
298 
299  **Steps** :
300 
301  1. *on new machine* : install your environment (*pseudocode*) ::
302 
@@ -19,28 +19,20 @@
303  2. *on old machine* : copy your cubicweb and apache configuration to the new machine ::
304 
305      scp /etc/cubicweb.d/ newmachine:/etc/cubicweb.d/
306      scp /etc/apache2/sites-available/ newmachine:/etc/apache2/sites-available/
307 
308 -3. *on new machine* : give new ids to pyro registration so the new instances can register ::
309 -
310 -     cd /etc/cubicweb.d/ ; sed -i.bck 's/^pyro-instance-id=.*$/\02/' */all-in-one.conf
311 -
312 -4. *on new machine* : start your instances ::
313 +3. *on new machine* : start your instances ::
314 
315       cubicweb start
316 
317 -5. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file.
318 +4. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file.
319 
320 -6. change dns entry from your oldmachine to newmachine
321 +5. change dns entry from your oldmachine to newmachine
322 
323 -7. shutdown your *old machine* (if it doesn't host other services or your database)
324 +6. shutdown your *old machine* (if it doesn't host other services or your database)
325 
326 -8. That's it.
327 +7. That's it.
328 
329  **Possible enhancements** : use right from the start a pound server behind your apache, that way you can add backends and smoothily migrate by shuting down backends that pound will take into account.
330 
331 -Migrate apache & cubicweb with pyro
332 ------------------------------------
333 
334 -FIXME TODO
335 -
diff --git a/doc/book/en/admin/pyro.rst b/doc/book/en/admin/pyro.rst
@@ -1,62 +0,0 @@
336 -.. _UsingPyro:
337 -
338 -Working with a distributed client (using Pyro)
339 -==============================================
340 -
341 -In some circumstances, it is practical to split the repository and
342 -web-client parts of the application for load-balancing reasons. Or
343 -one wants to access the repository from independant scripts to consult
344 -or update the database.
345 -
346 -Prerequisites
347 --------------
348 -
349 -For this to work, several steps have to be taken in order.
350 -
351 -You must first ensure that the appropriate software is installed and
352 -running (see :ref:`ConfigEnv`)::
353 -
354 -  pyro-nsd -x -p 6969
355 -
356 -Then you have to set appropriate options in your configuration. For
357 -instance::
358 -
359 -  pyro-server=yes
360 -  pyro-ns-host=localhost:6969
361 -
362 -  pyro-instance-id=myinstancename
363 -
364 -Connect to the CubicWeb repository from a python script
365 --------------------------------------------------------
366 -
367 -Assuming pyro-nsd is running and your instance is configured with ``pyro-server=yes``,
368 -you will be able to use :mod:`cubicweb.dbapi` api to initiate the connection.
369 -
370 -.. note::
371 -    Regardless of whether your instance is pyro activated or not, you can still
372 -    achieve this by using cubicweb-ctl shell scripts in a simpler way, as by default
373 -    it creates a repository 'in-memory' instead of connecting through pyro. That
374 -    also means you've to be on the host where the instance is running.
375 -
376 -Finally, the client (for instance a python script) must connect specifically
377 -as in the following example code:
378 -
379 -.. sourcecode:: python
380 -
381 -    from cubicweb import dbapi
382 -
383 -    cnx = dbapi.connect(database='instance-id', user='admin', password='admin')
384 -    cnx.load_appobjects()
385 -    cur = cnx.cursor()
386 -    for name in (u'Personal', u'Professional', u'Computers'):
387 -        cur.execute('INSERT Tag T: T name %(n)s', {'n': name})
388 -    cnx.commit()
389 -
390 -Calling :meth:`cubicweb.dbapi.load_appobjects`, will populate the
391 -cubicweb registries (see :ref:`VRegistryIntro`) with the application
392 -objects installed on the host where the script runs. You'll then be
393 -allowed to use the ORM goodies and custom entity methods and views. Of
394 -course this is optional, without it you can still get the repository
395 -data through the connection but in a roughly way: only RQL cursors
396 -will be available, e.g. you can't even build entity objects from the
397 -result set.
diff --git a/doc/features_list.rst b/doc/features_list.rst
@@ -43,11 +43,10 @@
398  | setup - configuration file                                         | 2  | 1  |
399  +--------------------------------------------------------------------+----+----+
400  | configuration - user / groups handling                             | 3  | 1  |
401  | configuration - site configuration                                 | 3  | 1  |
402  | configuration - distributed configuration                          | 2  | 1  |
403 -| configuration - pyro                                               | 2  | 2  |
404  +--------------------------------------------------------------------+----+----+
405  | multi-sources - capabilities                                       | NA | 0  |
406  | multi-sources - configuration                                      | 2  | 0  |
407  | multi-sources - ldap integration                                   | 2  | 1  |
408  +--------------------------------------------------------------------+----+----+
diff --git a/etwist/server.py b/etwist/server.py
@@ -63,18 +63,10 @@
409      def init_publisher(self):
410          config = self.config
411          # when we have an in-memory repository, clean unused sessions every XX
412          # seconds and properly shutdown the server
413          if config['repository-uri'] == 'inmemory://':
414 -            if config.pyro_enabled():
415 -                # if pyro is enabled, we have to register to the pyro name
416 -                # server, create a pyro daemon, and create a task to handle pyro
417 -                # requests
418 -                self.appli.repo.warning('remote repository access through pyro is deprecated')
419 -                self.pyro_daemon = self.appli.repo.pyro_register()
420 -                self.pyro_listen_timeout = 0.02
421 -                self.appli.repo.looping_task(1, self.pyro_loop_event)
422              if config.mode != 'test':
423                  reactor.addSystemEventTrigger('before', 'shutdown',
424                                                self.shutdown_event)
425                  self.appli.repo.start_looping_tasks()
426          self.set_url_rewriter()
@@ -91,17 +83,10 @@
427          """callback fired when the server is shutting down to properly
428          clean opened sessions
429          """
430          self.appli.repo.shutdown()
431 
432 -    def pyro_loop_event(self):
433 -        """listen for pyro events"""
434 -        try:
435 -            self.pyro_daemon.handleRequests(self.pyro_listen_timeout)
436 -        except select.error:
437 -            return
438 -
439      def getChild(self, path, request):
440          """Indicate which resource to use to process down the URL's path"""
441          return self
442 
443      def render(self, request):
diff --git a/etwist/twconfig.py b/etwist/twconfig.py
@@ -1,6 +1,6 @@
444 -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
445 +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
446  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
447  #
448  # This file is part of CubicWeb.
449  #
450  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -15,13 +15,10 @@
451  #
452  # You should have received a copy of the GNU Lesser General Public License along
453  # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
454  """twisted server configurations:
455 
456 -* the "twisted" configuration to get a web instance running in a standalone
457 -  twisted web server which talk to a repository server using Pyro
458 -
459  * the "all-in-one" configuration to get a web instance running in a twisted
460    web server integrating a repository server in the same process (only available
461    if the repository part of the software is installed
462  """
463  __docformat__ = "restructuredtext en"
@@ -80,17 +77,10 @@
464            'default': None,
465            'help': 'if this option is set, use the specified user to start \
466  the repository rather than the user running the command',
467            'group': 'main', 'level': WebConfiguration.mode == 'system'
468            }),
469 -        ('pyro-server',
470 -         {'type' : 'yn',
471 -          # pyro is only a recommends by default, so don't activate it here
472 -          'default': False,
473 -          'help': 'run a pyro server',
474 -          'group': 'main', 'level': 1,
475 -          }),
476          ('webserver-threadpool-size',
477           {'type': 'int',
478            'default': 4,
479            'help': "size of twisted's reactor threadpool. It should probably be not too \
480  much greater than connection-poolsize",
@@ -115,13 +105,10 @@
481          options = merge_options(WebConfigurationBase.options
482                                  + ServerConfiguration.options)
483 
484          cubicweb_appobject_path = WebConfigurationBase.cubicweb_appobject_path | ServerConfiguration.cubicweb_appobject_path
485          cube_appobject_path = WebConfigurationBase.cube_appobject_path | ServerConfiguration.cube_appobject_path
486 -        def pyro_enabled(self):
487 -            """tell if pyro is activated for the in memory repository"""
488 -            return self['pyro-server']
489 
490 
491      CONFIGURATIONS.append(AllInOneConfiguration)
492 
493  except ImportError:
diff --git a/repoapi.py b/repoapi.py
@@ -1,6 +1,6 @@
494 -# copyright 2013-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
495 +# copyright 2013-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
496  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
497  #
498  # This file is part of CubicWeb.
499  #
500  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -39,40 +39,21 @@
501  def get_repository(uri=None, config=None, vreg=None):
502      """get a repository for the given URI or config/vregistry (in case we're
503      loading the repository for a client, eg web server, configuration).
504 
505      The returned repository may be an in-memory repository or a proxy object
506 -    using a specific RPC method, depending on the given URI (pyro or zmq).
507 +    using a specific RPC method, depending on the given URI.
508      """
509      if uri is None:
510          return _get_inmemory_repo(config, vreg)
511 
512      protocol, hostport, appid = parse_repo_uri(uri)
513 
514      if protocol == 'inmemory':
515          # me may have been called with a dummy 'inmemory://' uri ...
516          return _get_inmemory_repo(config, vreg)
517 
518 -    if protocol == 'pyroloc':  # direct connection to the instance
519 -        from logilab.common.pyro_ext import get_proxy
520 -        uri = uri.replace('pyroloc', 'PYRO')
521 -        return get_proxy(uri)
522 -
523 -    if protocol == 'pyro':  # connection mediated through the pyro ns
524 -        from logilab.common.pyro_ext import ns_get_proxy
525 -        path = appid.strip('/')
526 -        if not path:
527 -            raise ConnectionError(
528 -                "can't find instance name in %s (expected to be the path component)"
529 -                % uri)
530 -        if '.' in path:
531 -            nsgroup, nsid = path.rsplit('.', 1)
532 -        else:
533 -            nsgroup = 'cubicweb'
534 -            nsid = path
535 -        return ns_get_proxy(nsid, defaultnsgroup=nsgroup, nshost=hostport)
536 -
537      if protocol.startswith('zmqpickle-'):
538          from cubicweb.zmqclient import ZMQRepositoryClient
539          return ZMQRepositoryClient(uri)
540      else:
541          raise ConnectionError('unknown protocol: `%s`' % protocol)
diff --git a/server/cwzmq.py b/server/cwzmq.py
@@ -17,29 +17,74 @@
542  # You should have received a copy of the GNU Lesser General Public License along
543  # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
544 
545  import cPickle
546  import traceback
547 +from time import localtime, mktime
548  from threading import Thread
549  from logging import getLogger
550 
551  import zmq
552  from zmq.eventloop import ioloop
553  import zmq.eventloop.zmqstream
554 
555  from cubicweb import set_log_methods
556 -from cubicweb.server.server import QuitEvent, Finished
557 
558  ctx = zmq.Context()
559 
560  def cwproto_to_zmqaddr(address):
561      """ converts a cw-zmq address (like zmqpickle-tcp://<ip>:<port>)
562      into a proper zmq address (tcp://<ip>:<port>)
563      """
564      assert address.startswith('zmqpickle-'), 'bad protocol string %s' % address
565      return address.split('-', 1)[1] # chop the `zmqpickle-` prefix
566 
567 +
568 +class Finished(Exception):
569 +    """raise to remove an event from the event loop"""
570 +
571 +class TimeEvent:
572 +    """base event"""
573 +    # timefunc = staticmethod(localtime)
574 +    timefunc = localtime
575 +
576 +    def __init__(self, absolute=None, period=None):
577 +        # local time tuple
578 +        if absolute is None:
579 +            absolute = self.timefunc()
580 +        self.absolute = absolute
581 +        # optional period in seconds
582 +        self.period = period
583 +
584 +    def is_ready(self):
585 +        """return  true if the event is ready to be fired"""
586 +        now = self.timefunc()
587 +        if self.absolute <= now:
588 +            return True
589 +        return False
590 +
591 +    def fire(self, server):
592 +        """fire the event
593 +        must be overridden by concrete events
594 +        """
595 +        raise NotImplementedError()
596 +
597 +    def update(self):
598 +        """update the absolute date for the event or raise a finished exception
599 +        """
600 +        if self.period is None:
601 +            raise Finished
602 +        self.absolute = localtime(mktime(self.absolute) + self.period)
603 +
604 +
605 +class QuitEvent(TimeEvent):
606 +    """stop the server"""
607 +    def fire(self, server):
608 +        server.repo.shutdown()
609 +        server.quiting = True
610 +
611 +
612  class ZMQComm(object):
613      """
614      A simple ZMQ-based notification bus.
615 
616      There should at most one instance of this class attached to a
diff --git a/server/repository.py b/server/repository.py
@@ -22,11 +22,10 @@
617  repository mainly:
618 
619  * brings these classes all together to provide a single access
620    point to a cubicweb instance.
621  * handles session management
622 -* provides method for pyro registration, to call if pyro is enabled
623  """
624  __docformat__ = "restructuredtext en"
625 
626  import sys
627  import threading
@@ -149,32 +148,24 @@
628 
629 
630  class Repository(object):
631      """a repository provides access to a set of persistent storages for
632      entities and relations
633 -
634 -    XXX protect pyro access
635      """
636 
637      def __init__(self, config, tasks_manager=None, vreg=None):
638          self.config = config
639          if vreg is None:
640              vreg = cwvreg.CWRegistryStore(config)
641          self.vreg = vreg
642          self._tasks_manager = tasks_manager
643 
644 -        self.pyro_registered = False
645 -        self.pyro_uri = None
646 -        # every pyro client is handled in its own thread; map these threads to
647 -        # the session we opened for them so we can clean up when they go away
648 -        self._pyro_sessions = {}
649          self.app_instances_bus = NullEventBus()
650          self.info('starting repository from %s', self.config.apphome)
651          # dictionary of opened sessions
652          self._sessions = {}
653 
654 -
655          # list of functions to be called at regular interval
656          # list of running threads
657          self._running_threads = []
658          # initial schema, should be build or replaced latter
659          self.schema = schema.CubicWebSchema(config.appid)
@@ -433,14 +424,10 @@
660              try:
661                  cnxset.close(True)
662              except Exception:
663                  self.exception('error while closing %s' % cnxset)
664                  continue
665 -        if self.pyro_registered:
666 -            if self._use_pyrons():
667 -                pyro_unregister(self.config)
668 -            self.pyro_uri = None
669          hits, misses = self.querier.cache_hit, self.querier.cache_miss
670          try:
671              self.info('rql st cache hit/miss: %s/%s (%s%% hits)', hits, misses,
672                        (hits * 100) / (hits + misses))
673              hits, misses = self.system_source.cache_hit, self.system_source.cache_miss
@@ -660,16 +647,10 @@
674          # use an internal connection
675          with self.internal_cnx() as cnx:
676              # try to get a user object
677              user = self.authenticate_user(cnx, login, **kwargs)
678          session = Session(user, self, cnxprops)
679 -        if threading.currentThread() in self._pyro_sessions:
680 -            # assume no pyro client does one get_repository followed by
681 -            # multiple repo.connect
682 -            assert self._pyro_sessions[threading.currentThread()] == None
683 -            self.debug('record session %s', session)
684 -            self._pyro_sessions[threading.currentThread()] = session
685          user._cw = user.cw_rset.req = session
686          user.cw_clear_relation_cache()
687          self._sessions[session.sessionid] = session
688          self.info('opened session %s for user %s', session.sessionid, login)
689          with session.new_cnx() as cnx:
@@ -695,14 +676,10 @@
690          session = self._get_session(sessionid, setcnxset=True, txid=txid)
691          try:
692              try:
693                  rset = self.querier.execute(session, rqlstring, args,
694                                              build_descr)
695 -                # NOTE: the web front will (re)build it when needed
696 -                #       e.g in facets
697 -                #       Zeroed to avoid useless overhead with pyro
698 -                rset._rqlst = None
699                  return rset
700              except (ValidationError, Unauthorized, RQLSyntaxError):
701                  raise
702              except Exception:
703                  # FIXME: check error to catch internal errors
@@ -808,12 +785,10 @@
704              self.hm.call_hooks('session_close', cnx)
705              # commit connection at this point in case write operation has been
706              # done during `session_close` hooks
707              cnx.commit()
708          session.close()
709 -        if threading.currentThread() in self._pyro_sessions:
710 -            self._pyro_sessions[threading.currentThread()] = None
711          del self._sessions[sessionid]
712          self.info('closed session %s for user %s', sessionid, session.user.login)
713 
714      def call_service(self, sessionid, regid, **kwargs):
715          """
@@ -1347,81 +1322,14 @@
716          cnx.update_rel_cache_del(subject, rtype, object, rschema.symmetric)
717          self.hm.call_hooks('after_delete_relation', cnx,
718                             eidfrom=subject, rtype=rtype, eidto=object)
719 
720 
721 -    # pyro handling ###########################################################
722 -
723 -    @property
724 -    @cached
725 -    def pyro_appid(self):
726 -        from logilab.common import pyro_ext as pyro
727 -        config = self.config
728 -        appid = '%s.%s' % pyro.ns_group_and_id(
729 -            config['pyro-instance-id'] or config.appid,
730 -            config['pyro-ns-group'])
731 -        # ensure config['pyro-instance-id'] is a full qualified pyro name
732 -        config['pyro-instance-id'] = appid
733 -        return appid
734 -
735 -    def _use_pyrons(self):
736 -        """return True if the pyro-ns-host is set to something else
737 -        than NO_PYRONS, meaning we want to go through a pyro
738 -        nameserver"""
739 -        return self.config['pyro-ns-host'] != 'NO_PYRONS'
740 -
741 -    def pyro_register(self, host=''):
742 -        """register the repository as a pyro object"""
743 -        from logilab.common import pyro_ext as pyro
744 -        daemon = pyro.register_object(self, self.pyro_appid,
745 -                                      daemonhost=self.config['pyro-host'],
746 -                                      nshost=self.config['pyro-ns-host'],
747 -                                      use_pyrons=self._use_pyrons())
748 -        self.info('repository registered as a pyro object %s', self.pyro_appid)
749 -        self.pyro_uri =  pyro.get_object_uri(self.pyro_appid)
750 -        self.info('pyro uri is: %s', self.pyro_uri)
751 -        self.pyro_registered = True
752 -        # register a looping task to regularly ensure we're still registered
753 -        # into the pyro name server
754 -        if self._use_pyrons():
755 -            self.looping_task(60*10, self._ensure_pyro_ns)
756 -        pyro_sessions = self._pyro_sessions
757 -        # install hacky function to free cnxset
758 -        def handleConnection(conn, tcpserver, sessions=pyro_sessions):
759 -            sessions[threading.currentThread()] = None
760 -            return tcpserver.getAdapter().__class__.handleConnection(tcpserver.getAdapter(), conn, tcpserver)
761 -        daemon.getAdapter().handleConnection = handleConnection
762 -        def removeConnection(conn, sessions=pyro_sessions):
763 -            daemon.__class__.removeConnection(daemon, conn)
764 -            session = sessions.pop(threading.currentThread(), None)
765 -            if session is None:
766 -                # client was not yet connected to the repo
767 -                return
768 -            if not session.closed:
769 -                self.close(session.sessionid)
770 -        daemon.removeConnection = removeConnection
771 -        return daemon
772 -
773 -    def _ensure_pyro_ns(self):
774 -        if not self._use_pyrons():
775 -            return
776 -        from logilab.common import pyro_ext as pyro
777 -        pyro.ns_reregister(self.pyro_appid, nshost=self.config['pyro-ns-host'])
778 -        self.info('repository re-registered as a pyro object %s',
779 -                  self.pyro_appid)
780 
781 
782      # these are overridden by set_log_methods below
783      # only defining here to prevent pylint from complaining
784      info = warning = error = critical = exception = debug = lambda msg, *a, **kw: None
785 
786 -
787 -def pyro_unregister(config):
788 -    """unregister the repository from the pyro name server"""
789 -    from logilab.common.pyro_ext import ns_unregister
790 -    appid = config['pyro-instance-id'] or config.appid
791 -    ns_unregister(appid, config['pyro-ns-group'], config['pyro-ns-host'])
792 -
793 -
794  from logging import getLogger
795  from cubicweb import set_log_methods
796  set_log_methods(Repository, getLogger('cubicweb.repository'))
diff --git a/server/server.py b/server/server.py
@@ -1,140 +0,0 @@
797 -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
798 -# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
799 -#
800 -# This file is part of CubicWeb.
801 -#
802 -# CubicWeb is free software: you can redistribute it and/or modify it under the
803 -# terms of the GNU Lesser General Public License as published by the Free
804 -# Software Foundation, either version 2.1 of the License, or (at your option)
805 -# any later version.
806 -#
807 -# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
808 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
809 -# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
810 -# details.
811 -#
812 -# You should have received a copy of the GNU Lesser General Public License along
813 -# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
814 -"""Pyro RQL server"""
815 -
816 -__docformat__ = "restructuredtext en"
817 -
818 -import select
819 -from time import localtime, mktime
820 -
821 -from cubicweb.server.utils import TasksManager
822 -from cubicweb.server.repository import Repository
823 -
824 -class Finished(Exception):
825 -    """raise to remove an event from the event loop"""
826 -
827 -class TimeEvent:
828 -    """base event"""
829 -    # timefunc = staticmethod(localtime)
830 -    timefunc = localtime
831 -
832 -    def __init__(self, absolute=None, period=None):
833 -        # local time tuple
834 -        if absolute is None:
835 -            absolute = self.timefunc()
836 -        self.absolute = absolute
837 -        # optional period in seconds
838 -        self.period = period
839 -
840 -    def is_ready(self):
841 -        """return  true if the event is ready to be fired"""
842 -        now = self.timefunc()
843 -        if self.absolute <= now:
844 -            return True
845 -        return False
846 -
847 -    def fire(self, server):
848 -        """fire the event
849 -        must be overridden by concrete events
850 -        """
851 -        raise NotImplementedError()
852 -
853 -    def update(self):
854 -        """update the absolute date for the event or raise a finished exception
855 -        """
856 -        if self.period is None:
857 -            raise Finished
858 -        self.absolute = localtime(mktime(self.absolute) + self.period)
859 -
860 -
861 -class QuitEvent(TimeEvent):
862 -    """stop the server"""
863 -    def fire(self, server):
864 -        server.repo.shutdown()
865 -        server.quiting = True
866 -
867 -
868 -class RepositoryServer(object):
869 -
870 -    def __init__(self, config):
871 -        """make the repository available as a PyRO object"""
872 -        self.config = config
873 -        self.repo = Repository(config, TasksManager())
874 -        self.ns = None
875 -        self.quiting = None
876 -        # event queue
877 -        self.events = []
878 -
879 -    def add_event(self, event):
880 -        """add an event to the loop"""
881 -        self.info('adding event %s', event)
882 -        self.events.append(event)
883 -
884 -    def trigger_events(self):
885 -        """trigger ready events"""
886 -        for event in self.events[:]:
887 -            if event.is_ready():
888 -                self.info('starting event %s', event)
889 -                event.fire(self)
890 -                try:
891 -                    event.update()
892 -                except Finished:
893 -                    self.events.remove(event)
894 -
895 -    def run(self, req_timeout=5.0):
896 -        """enter the service loop"""
897 -        # start repository looping tasks
898 -        self.repo.start_looping_tasks()
899 -        while self.quiting is None:
900 -            try:
901 -                self.daemon.handleRequests(req_timeout)
902 -            except select.error:
903 -                continue
904 -            finally:
905 -                self.trigger_events()
906 -
907 -    def quit(self):
908 -        """stop the server"""
909 -        self.add_event(QuitEvent())
910 -
911 -    def connect(self, host='', port=0):
912 -        """the connect method on the repository only register to pyro if
913 -        necessary
914 -        """
915 -        self.daemon = self.repo.pyro_register(host)
916 -
917 -    # server utilitities ######################################################
918 -
919 -    def install_sig_handlers(self):
920 -        """install signal handlers"""
921 -        import signal
922 -        self.info('installing signal handlers')
923 -        signal.signal(signal.SIGINT, lambda x, y, s=self: s.quit())
924 -        signal.signal(signal.SIGTERM, lambda x, y, s=self: s.quit())
925 -
926 -
927 -    # these are overridden by set_log_methods below
928 -    # only defining here to prevent pylint from complaining
929 -    @classmethod
930 -    def info(cls, msg, *a, **kw):
931 -        pass
932 -
933 -from logging import getLogger
934 -from cubicweb import set_log_methods
935 -LOGGER = getLogger('cubicweb.reposerver')
936 -set_log_methods(RepositoryServer, LOGGER)
diff --git a/server/serverconfig.py b/server/serverconfig.py
@@ -1,6 +1,6 @@
937 -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
938 +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
939  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
940  #
941  # This file is part of CubicWeb.
942  #
943  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -195,40 +195,10 @@
944            'default': (),
945            'help': 'comma separated list of email addresses that will be \
946  notified of every changes.',
947            'group': 'email', 'level': 2,
948            }),
949 -        # pyro services config
950 -        ('pyro-host',
951 -         {'type' : 'string',
952 -          'default': None,
953 -          'help': 'Pyro server host, if not detectable correctly through \
954 -gethostname(). It may contains port information using <host>:<port> notation, \
955 -and if not set, it will be choosen randomly',
956 -          'group': 'pyro', 'level': 3,
957 -          }),
958 -        ('pyro-instance-id',
959 -         {'type' : 'string',
960 -          'default': lgconfig.Method('default_instance_id'),
961 -          'help': 'identifier of the CubicWeb instance in the Pyro name server',
962 -          'group': 'pyro', 'level': 1,
963 -          }),
964 -        ('pyro-ns-host',
965 -         {'type' : 'string',
966 -          'default': '',
967 -          'help': 'Pyro name server\'s host. If not set, will be detected by a \
968 -broadcast query. It may contains port information using <host>:<port> notation. \
969 -Use "NO_PYRONS" to create a Pyro server but not register to a pyro nameserver',
970 -          'group': 'pyro', 'level': 1,
971 -          }),
972 -        ('pyro-ns-group',
973 -         {'type' : 'string',
974 -          'default': 'cubicweb',
975 -          'help': 'Pyro name server\'s group where the repository will be \
976 -registered.',
977 -          'group': 'pyro', 'level': 1,
978 -          }),
979          # zmq services config
980          ('zmq-repository-address',
981           {'type' : 'string',
982            'default': None,
983            'help': ('ZMQ URI on which the repository will be bound '
@@ -348,14 +318,10 @@
984                              self.error('skip unknown option %s in sources file' % attr)
985                  sconfig = _sconfig
986              stream.write('[%s]\n%s\n' % (section, generate_source_config(sconfig)))
987          restrict_perms_to_user(sourcesfile)
988 
989 -    def pyro_enabled(self):
990 -        """pyro is always enabled in standalone repository configuration"""
991 -        return True
992 -
993      def load_schema(self, expand_cubes=False, **kwargs):
994          from cubicweb.schema import CubicWebSchemaLoader
995          if expand_cubes:
996              # in case some new dependencies have been introduced, we have to
997              # reinitialize cubes so the full filesystem schema is read
diff --git a/server/serverctl.py b/server/serverctl.py
@@ -165,15 +165,10 @@
998          """
999          config = self.config
1000          if not automatic:
1001              print underline_title('Configuring the repository')
1002              config.input_config('email', inputlevel)
1003 -            # ask for pyro configuration if pyro is activated and we're not
1004 -            # using a all-in-one config, in which case this is done by the web
1005 -            # side command handler
1006 -            if config.pyro_enabled() and config.name != 'all-in-one':
1007 -                config.input_config('pyro', inputlevel)
1008              print '\n'+underline_title('Configuring the sources')
1009          sourcesfile = config.sources_file()
1010          # hack to make Method('default_instance_id') usable in db option defs
1011          # (in native.py)
1012          sconfig = SourceConfiguration(config,
@@ -319,16 +314,11 @@
1013  class RepositoryStopHandler(CommandHandler):
1014      cmdname = 'stop'
1015      cfgname = 'repository'
1016 
1017      def poststop(self):
1018 -        """if pyro is enabled, ensure the repository is correctly unregistered
1019 -        """
1020 -        if self.config.pyro_enabled():
1021 -            from cubicweb.server.repository import pyro_unregister
1022 -            pyro_unregister(self.config)
1023 -
1024 +        pass
1025 
1026  # repository specific commands ################################################
1027 
1028  def createdb(helper, source, dbcnx, cursor, **kwargs):
1029      if dbcnx.logged_user != source['db-user']:
@@ -687,11 +677,11 @@
1030 
1031 
1032  class StartRepositoryCommand(Command):
1033      """Start a CubicWeb RQL server for a given instance.
1034 
1035 -    The server will be remotely accessible through pyro or ZMQ
1036 +    The server will be remotely accessible through ZMQ
1037 
1038      <instance>
1039        the identifier of the instance to initialize.
1040      """
1041      name = 'start-repository'
@@ -707,27 +697,22 @@
1042            'help': 'debug if -D is set, error otherwise',
1043            }),
1044          ('address',
1045           {'short': 'a', 'type': 'string', 'metavar': '<protocol>://<host>:<port>',
1046            'default': '',
1047 -          'help': ('specify a ZMQ URI on which to bind, or use "pyro://"'
1048 -                   'to create a pyro-based repository'),
1049 +          'help': ('specify a ZMQ URI on which to bind'),
1050            }),
1051          )
1052 
1053      def create_repo(self, config):
1054          address = self['address']
1055          if not address:
1056 -            address = config.get('zmq-repository-address') or 'pyro://'
1057 -        if address.startswith('pyro://'):
1058 -            from cubicweb.server.server import RepositoryServer
1059 -            return RepositoryServer(config), config['host']
1060 -        else:
1061 -            from cubicweb.server.utils import TasksManager
1062 -            from cubicweb.server.cwzmq import ZMQRepositoryServer
1063 -            repo = Repository(config, TasksManager())
1064 -            return ZMQRepositoryServer(repo), address
1065 +            address = config.get('zmq-repository-address')
1066 +        from cubicweb.server.utils import TasksManager
1067 +        from cubicweb.server.cwzmq import ZMQRepositoryServer
1068 +        repo = Repository(config, TasksManager())
1069 +        return ZMQRepositoryServer(repo), address
1070 
1071      def run(self, args):
1072          from logilab.common.daemon import daemonize, setugid
1073          from cubicweb.cwctl import init_cmdline_log_threshold
1074          print 'WARNING: Standalone repository with pyro or zmq access is deprecated'
diff --git a/server/test/unittest_repository.py b/server/test/unittest_repository.py
@@ -310,59 +310,10 @@
1075          self.assertEqual(cstr.expression, 'O final TRUE')
1076 
1077          ownedby = schema.rschema('owned_by')
1078          self.assertEqual(ownedby.objects('CWEType'), ('CWUser',))
1079 
1080 -    def test_pyro(self):
1081 -        import Pyro
1082 -        Pyro.config.PYRO_MULTITHREADED = 0
1083 -        done = []
1084 -        self.repo.config.global_set_option('pyro-ns-host', 'NO_PYRONS')
1085 -        daemon = self.repo.pyro_register()
1086 -        try:
1087 -            uri = self.repo.pyro_uri.replace('PYRO', 'pyroloc')
1088 -            # the client part has to be in the thread due to sqlite limitations
1089 -            t = threading.Thread(target=self._pyro_client, args=(uri, done))
1090 -            t.start()
1091 -            while not done:
1092 -                daemon.handleRequests(1.0)
1093 -            t.join(1)
1094 -            if t.isAlive():
1095 -                self.fail('something went wrong, thread still alive')
1096 -        finally:
1097 -            repository.pyro_unregister(self.repo.config)
1098 -            from logilab.common import pyro_ext
1099 -            pyro_ext._DAEMONS.clear()
1100 -
1101 -
1102 -    def _pyro_client(self, uri, done):
1103 -        cnx = connect(uri,
1104 -                      u'admin', password='gingkow',
1105 -                      initlog=False) # don't reset logging configuration
1106 -        try:
1107 -            cnx.load_appobjects(subpath=('entities',))
1108 -            # check we can get the schema
1109 -            schema = cnx.get_schema()
1110 -            self.assertTrue(cnx.vreg)
1111 -            self.assertTrue('etypes'in cnx.vreg)
1112 -            cu = cnx.cursor()
1113 -            rset = cu.execute('Any U,G WHERE U in_group G')
1114 -            user = iter(rset.entities()).next()
1115 -            self.assertTrue(user._cw)
1116 -            self.assertTrue(user._cw.vreg)
1117 -            from cubicweb.entities import authobjs
1118 -            self.assertIsInstance(user._cw.user, authobjs.CWUser)
1119 -            # make sure the tcp connection is closed properly; yes, it's disgusting.
1120 -            adapter = cnx._repo.adapter
1121 -            cnx.close()
1122 -            adapter.release()
1123 -            done.append(True)
1124 -        finally:
1125 -            # connect monkey patch some method by default, remove them
1126 -            multiple_connections_unfix()
1127 -
1128 -
1129      def test_zmq(self):
1130          try:
1131              import zmq
1132          except ImportError:
1133              self.skipTest("zmq in not available")
diff --git a/server/test/unittest_tools.py b/server/test/unittest_tools.py
@@ -21,11 +21,10 @@
1134  from logilab.common.testlib import TestCase, unittest_main
1135 
1136  class ImportTC(TestCase):
1137      def test(self):
1138          # the minimal test: module is importable...
1139 -        import cubicweb.server.server
1140          import cubicweb.server.checkintegrity
1141          import cubicweb.server.serverctl
1142 
1143  if __name__ == '__main__':
1144      unittest_main()
diff --git a/test/unittest_utils.py b/test/unittest_utils.py
@@ -56,14 +56,10 @@
1145      def test_parse_repo_uri(self):
1146          self.assertEqual(('inmemory', None, 'myapp'),
1147                           parse_repo_uri('myapp'))
1148          self.assertEqual(('inmemory', None, 'myapp'),
1149                           parse_repo_uri('inmemory://myapp'))
1150 -        self.assertEqual(('pyro', 'pyro-ns-host:pyro-ns-port', '/myapp'),
1151 -                         parse_repo_uri('pyro://pyro-ns-host:pyro-ns-port/myapp'))
1152 -        self.assertEqual(('pyroloc', 'host:port', '/appkey'),
1153 -                         parse_repo_uri('pyroloc://host:port/appkey'))
1154          self.assertEqual(('zmqpickle-tcp', '127.0.0.1:666', ''),
1155                           parse_repo_uri('zmqpickle-tcp://127.0.0.1:666'))
1156          with self.assertRaises(NotImplementedError):
1157              parse_repo_uri('foo://bar')
1158 
diff --git a/transaction.py b/transaction.py
@@ -1,6 +1,6 @@
1159 -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
1160 +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
1161  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
1162  #
1163  # This file is part of CubicWeb.
1164  #
1165  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -13,17 +13,11 @@
1166  # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
1167  # details.
1168  #
1169  # You should have received a copy of the GNU Lesser General Public License along
1170  # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
1171 -"""undoable transaction objects.
1172 -
1173 -
1174 -This module is in the cubicweb package and not in cubicweb.server because those
1175 -objects should be accessible to client through pyro, where the cubicweb.server
1176 -package may not be installed.
1177 -"""
1178 +""" undoable transaction objects. """
1179  __docformat__ = "restructuredtext en"
1180  _ = unicode
1181 
1182  from cubicweb import RepositoryError
1183 
diff --git a/utils.py b/utils.py
@@ -19,11 +19,10 @@
1184 
1185  from __future__ import division
1186 
1187  __docformat__ = "restructuredtext en"
1188 
1189 -import sys
1190  import decimal
1191  import datetime
1192  import random
1193  import re
1194  import json
@@ -606,20 +605,19 @@
1195 
1196  def parse_repo_uri(uri):
1197      """ transform a command line uri into a (protocol, hostport, appid), e.g:
1198      <myapp>                      -> 'inmemory', None, '<myapp>'
1199      inmemory://<myapp>           -> 'inmemory', None, '<myapp>'
1200 -    pyro://[host][:port]         -> 'pyro', 'host:port', None
1201      zmqpickle://[host][:port]    -> 'zmqpickle', 'host:port', None
1202      """
1203      parseduri = urlparse(uri)
1204      scheme = parseduri.scheme
1205      if scheme == '':
1206          return ('inmemory', None, parseduri.path)
1207      if scheme == 'inmemory':
1208          return (scheme, None, parseduri.netloc)
1209 -    if scheme in ('pyro', 'pyroloc') or scheme.startswith('zmqpickle-'):
1210 +    if scheme.startswith('zmqpickle-'):
1211          return (scheme, parseduri.netloc, parseduri.path)
1212      raise NotImplementedError('URI protocol not implemented for `%s`' % uri)
1213 
1214 
1215 
diff --git a/web/webctl.py b/web/webctl.py
@@ -44,13 +44,10 @@
1216      def bootstrap(self, cubes, automatic=False, inputlevel=0):
1217          """bootstrap this configuration"""
1218          if not automatic:
1219              print '\n' + underline_title('Generic web configuration')
1220              config = self.config
1221 -            if config['repository-uri'].startswith('pyro://') or config.pyro_enabled():
1222 -                print '\n' + underline_title('Pyro configuration')
1223 -                config.input_config('pyro', inputlevel)
1224              config.input_config('web', inputlevel)
1225              if ASK.confirm('Allow anonymous access ?', False):
1226                  config.global_set_option('anonymous-user', 'anon')
1227                  config.global_set_option('anonymous-password', 'anon')
1228 
diff --git a/zmqclient.py b/zmqclient.py
@@ -1,6 +1,6 @@
1229 -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
1230 +# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
1231  # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
1232  #
1233  # This file is part of CubicWeb.
1234  #
1235  # CubicWeb is free software: you can redistribute it and/or modify it under the
@@ -13,11 +13,11 @@
1236  # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
1237  # details.
1238  #
1239  # You should have received a copy of the GNU Lesser General Public License along
1240  # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
1241 -"""Source to query another RQL repository using pyro"""
1242 +"""Source to query another RQL repository using ZMQ"""
1243 
1244  __docformat__ = "restructuredtext en"
1245  _ = unicode
1246 
1247  from functools import partial