def publish(self):
    LOG.info('{}: {}'.format(crayons.yellow('publishing data to target'), self.target['url']))
    try:
        publisher = getattr(importlib.import_module('cinfo.drivers.{}'.format(self.target['type'])), self.target['type'].capitalize())()
    except KeyError:
        LOG.error('{}: {}...exiting'.format(crayons.red('No such target'), self.target))
        sys.exit(2)
    publisher.publish(self.data)
def publish(self):
    LOG.info('{}: {}'.format(crayons.yellow('publishing data to target'), self.target['url']))
    try:
        publisher = getattr(importlib.import_module('cinfo.drivers.{}'.format(self.target['type'])), self.target['type'].capitalize())()
    except KeyError:
        LOG.error('{}: {}...exiting'.format(crayons.red('No such target'), self.target))
        sys.exit(2)
    publisher.publish(self.data)