Example #1
0
                self._launch_amipacker_series(db, child, self._get_template(child), sha1,
                                              committer, committer_mail, comment, notify, causedby)


if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='AMIPacker wrapper args')

    # should be ~/clone or ~/src/github.com/TrendMicroDCS
    parser.add_argument("-r", "--repo", type=str, help="target packer template repo master", required=True)

    # configs
    args = parser.parse_args()
    configs = OmeletConfigParser()

    # logging
    logging.config.fileConfig(os.path.join(configs.get_omelet_config_dir(), 'logging.ini'))
    logger = logging.getLogger(__name__)

    # aws key
    aws_key = Credential()

    # mail sender
    omelet_notifier = Notifier(configs.get_sns_region(), aws_key.get_aws_access_key(),
                               aws_key.get_aws_secret_key())

    try:
        amipacker_launcher = OmeletAMIPacker(configs, aws_key, args.repo)
        ret = amipacker_launcher.launch()
        if ret:
            omelet_notifier.send(configs.get_sns_topic("amipacker"),
                                 "Validation error: template is in the wrong path", ret)