def load_tactic(dpath, basedir): """Load a tactic from the current layer using a dotted path. The last element in the path should be a Tactic subclass """ obj = utils.load_class(dpath, basedir) if not issubclass(obj, Tactic): raise ValueError("Expected to load a tactic for %s" % dpath) return obj
def load_tactic(dpath, basedir): """ Load a tactic from the current layer using a dotted path. The final element in the path should be a :class:`~charmtools.build.tactics.Tactic` subclass. """ obj = utils.load_class(dpath, basedir) if not issubclass(obj, Tactic): raise ValueError("Expected to load a tactic for %s" % dpath) return obj