misc/migration/3.16.0_Any.py
author Nicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 14 Feb 2013 16:45:07 +0100
changeset 8697 574bb05e40a4
parent 8675 b60329e40e26
permissions -rw-r--r--
[toward py3k] rewrite has_key() (part of #2711624) The `has_key` method is not in Python3K but dict supports __contains__ check for ages.

sync_schema_props_perms('EmailAddress')

for source in rql('CWSource X WHERE X type "pyrorql"').entities():
    sconfig = source.dictconfig
    nsid = sconfig.pop('pyro-ns-id', config.appid)
    nshost = sconfig.pop('pyro-ns-host', '')
    nsgroup = sconfig.pop('pyro-ns-group', ':cubicweb')
    if nsgroup:
        nsgroup += '.'
    source.cw_set(url=u'pyro://%s/%s%s' % (nshost, nsgroup, nsid))
    source.update_config(skip_unknown=True, **sconfig)

commit()