I got the solution.
The problem was the atributte _cmisClient of the repo.
When the repo is created with client.defaultRepository the repo properties are:
>>> repo_default.__dict__
{
'_capabilities': {},
'_repositoryName': None,
'_permDefs': {},
'_permMap': {},
'_propagation': None,
'_repositoryInfo': {},
'_cmisClient': < cmislib.model.CmisClient object at 0x107a0b250 > ,
'_repositoryId': None,
'logger': < logging.Logger object at 0x107faca10 > ,
'_permissions': None,
'xmlDoc': < DOM Element: app: workspace at 0x1083ef998 > ,
'_uriTemplates': {}
}
When the repo is created using client.getRepository(repositoryId)
>>> repo.__dict__
{
'_capabilities': {},
'_repositoryName': None,
'_permDefs': {},
'_permMap': {},
'_propagation': None,
'_repositoryInfo': {},
'_cmisClient': < cmislib.atompub.binding.RepositoryService object at 0x10814fc10 > ,
'_repositoryId': None,
'logger': < logging.Logger object at 0x107faca10 > ,
'_permissions': None,
'xmlDoc': < DOM Element: app: workspace at 0x108786170 > ,
'_uriTemplates': {}
}
The first case _cmisClient has binding attribute:
{
'username': 'REPO_USER',
'repositoryUrl': 'REPO_URL',
'binding': < cmislib.atompub.binding.AtomPubBinding object at 0x107f2e550 > ,
'extArgs': {},
'logger': < logging.Logger object at 0x107f2e590 > ,
'password': 'REPO_PWD'
}
But the second case doesn't:
{
'logger': < logging.Logger object at 0x107f2e5d0 > ,
'_uriTemplates': {}
}
The problem is related how is build the repo. It is done in cmislib/atompub/binding.py, class RepositoryService.
In the first case, the repo is done in getDefaultRepository(self, client) and the repo is done with the following command:
repository = AtomPubRepository(client, [e for e in workspaceElements if e.nodeType == e.ELEMENT_NODE][0])
While in the second case, the repo is done in the method getRepository(self, client, repositoryId)
return AtomPubRepository(self, workspaceElement)
self is RepositoryService.
So, the fix is replace self with client:
return AtomPubRepository(client, workspaceElement)
I hope it helps.
UPDATE:
I have forked the original cmislib with the fix for this problem:
https://github.com/sergioescudero/chemistry-cmislib