# Butler inconsistently resolves duplicate repositories

XMLWordPrintable

## Details

• Type: Bug
• Status: To Do
• Resolution: Unresolved
• Fix Version/s: None
• Component/s:
• Labels:
• Templates:
• Story Points:
2

## Description

I've run into a situation where I wish to create a Butler that may have one or more input repositories. In other words, I'm calling (slightly simplified):

 Butler(inputs=[{'root': repo1}, {'root': repo2}], outputs={'root': outputRepo, 'mode': 'rw'}) 

where the URIs repo1 and repo2 may represent the same location. When I first do this, the Butler detects whether the two repositories are the same, and if so removes the duplicate parent from outputRepo. So far, so good.

However, if I rerun the program with the same repositories, I get the following error:

 ParentMismatch exception: The beginning of the passed-in parents list: [RepositoryCfg(root=,  ...,  parents=[],  policy=None),  RepositoryCfg(root=,  ...,  parents=[],  policy=None)] does not match the existing parents list in this RepositoryCfg: [RepositoryCfg(root=,  ...,  parents=[],  policy=None)] 

Aside from relative vs. absolute paths, the only difference between the two lists is that the former has a duplicate entry while the latter does not. Adding an explicit os.path.samefile(repo1, repo2) test to the calling code causes the problem to go away, so I assume it's the not-yet-pruned duplicates that are the problem. However, I'd prefer to not have to assume that the repository URIs are filesystem paths.

Would it be possible to fix the test so that it's the "reduced" parent lists that get compared?

## People

• Assignee:
Unassigned
Reporter:
Krzysztof Findeisen
Watchers:
Krzysztof Findeisen, Nate Pease, Russell Owen