25 from lsst.daf.butler.cli.opt.repo
import repo_option
26 from lsst.daf.butler
import Butler
27 from ..opt
import instrument_option
28 from ...utils
import getInstrument
30 log = logging.getLogger(__name__)
34 @instrument_option(required=
True, helpMsg=
"The fully-qualified name of an Instrument subclass.")
35 @repo_option(required=
True)
38 """Add an instrument to the data repository.
40 butler = Butler(repo, writeable=
True)
43 except RuntimeError
as err:
44 log.critical(
"Failed getting instrument %s with exception %s", instrument, err)
45 raise click.ClickException(
"Could not import instrument.")
47 raise click.ClickException(f
"{instrument} is not a subclass of obs.base.Instrument")
48 instr.register(butler.registry)