misc/migration/3.16.0_Any.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 04 Jan 2013 15:39:52 +0100
changeset 8675 b60329e40e26
permissions -rw-r--r--
[rql sources] uses an URL as remote host address for pyro/zmq rql sources, instead of extra configuration parameters. Follows modification of dbapi.connect api. Closes #2539822
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8675
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     1
sync_schema_props_perms('EmailAddress')
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     2
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     3
for source in rql('CWSource X WHERE X type "pyrorql"').entities():
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     4
    sconfig = source.dictconfig
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     5
    nsid = sconfig.pop('pyro-ns-id', config.appid)
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     6
    nshost = sconfig.pop('pyro-ns-host', '')
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     7
    nsgroup = sconfig.pop('pyro-ns-group', ':cubicweb')
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     8
    if nsgroup:
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
     9
        nsgroup += '.'
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    10
    source.cw_set(url=u'pyro://%s/%s%s' % (nshost, nsgroup, nsid))
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    11
    source.update_config(skip_unknown=True, **sconfig)
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    12
b60329e40e26 [rql sources] uses an URL as remote host address for pyro/zmq rql sources,
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
diff changeset
    13
commit()