replaceRoot

lsst.daf.butler.core.repoRelocation.replaceRoot(configRoot, butlerRoot)

Update a configuration root with the butler root location.

No changes are made if the special root string is not found in the configuration entry. The name of the tag is defined in the module variable BUTLER_ROOT_TAG.

Parameters:
configRoot : str

Directory root location as specified in a configuration file.

butlerRoot : str

Butler root directory. Absolute path is inserted into the configRoot where the BUTLER_ROOT_TAG string is found. If None the current working directory is used for the root.

Returns:
newRoot : str

New configuration string, with the root tag replaced with the butler root if that tag was present in the supplied configuration root.