def main(): parser = argparse.ArgumentParser(description="DNS Build scripts") parser.add_argument( "--stage-only", dest="STAGE_ONLY", action="store_true", default=False, help="Just build staging and don't " "copy to prod. named-checkzone will still be run.", ) parser.add_argument( "--clobber-stage", dest="CLOBBER_STAGE", action="store_true", default=False, help="If stage " "already exists delete it before running the build " "script.", ) parser.add_argument( "--ship-it", dest="PUSH_TO_PROD", action="store_true", default=False, help="Check files " "into rcs and push upstream.", ) parser.add_argument( "--preserve-stage", dest="PRESERVE_STAGE", action="store_true", default=False, help="Do not " "remove staging area after build completes.", ) parser.add_argument( "--no-build", dest="BUILD_ZONES", action="store_false", default=True, help="Do not " "build zone files." ) parser.add_argument( "--no-syslog", dest="LOG_SYSLOG", action="store_false", default=True, help="Do not " "log to syslog." ) parser.add_argument( "--debug", dest="DEBUG", action="store_true", default=False, help="Print " "copious amounts of text." ) parser.add_argument( "--first-run", dest="FIRST_RUN", action="store_true", default=False, help="Ignore " "all change delta thresholds.", ) nas = parser.parse_args(sys.argv[1:]) b = DNSBuilder(**dict(nas._get_kwargs())) try: b.build_dns() except BuildError as why: b.log("LOG_ERR", why) # fail_mail(message.format(why)) except Exception as err: # Make some noise # fail_mail(message.format(err)) b.log("LOG_CRIT", err) raise
def build_dns(): args = {'FIRST_RUN': False, 'PRESERVE_STAGE': False, 'PUSH_TO_PROD': False, 'BUILD_ZONES': True, 'LOG_SYSLOG': True, 'CLOBBER_STAGE': True, 'STAGE_ONLY': False, 'DEBUG': False } b = DNSBuilder(**args) try: b.build_dns() except BuildError as why: b.log(why, 'LOG_ERR') except Exception as err: b.log(err, 'LOG_CRIT') raise
def build_dns(): args = { 'FIRST_RUN': False, 'PRESERVE_STAGE': False, 'PUSH_TO_PROD': False, 'BUILD_ZONES': True, 'LOG_SYSLOG': True, 'CLOBBER_STAGE': True, 'STAGE_ONLY': False, 'DEBUG': False } b = DNSBuilder(**args) try: b.build_dns() except BuildError as why: b.log('LOG_ERR', why) except Exception as err: b.log('LOG_CRIT', err) raise
def main(): parser = argparse.ArgumentParser(description='DNS Build scripts') parser.add_argument('--stage-only', dest='STAGE_ONLY', action='store_true', default=False, help="Just build staging and don't " "copy to prod. named-checkzone will still be run.") parser.add_argument('--clobber-stage', dest='CLOBBER_STAGE', action='store_true', default=False, help="If stage " "already exists delete it before running the build " "script.") parser.add_argument('--ship-it', dest='PUSH_TO_PROD', action='store_true', default=False, help="Check files " "into rcs and push upstream.") parser.add_argument('--preserve-stage', dest='PRESERVE_STAGE', action='store_true', default=False, help="Do not " "remove staging area after build completes.") parser.add_argument('--no-build', dest='BUILD_ZONES', action='store_false', default=True, help="Do not " "build zone files.") parser.add_argument('--no-syslog', dest='LOG_SYSLOG', action='store_false', default=True, help="Do not " "log to syslog.") parser.add_argument('--debug', dest='DEBUG', action='store_true', default=False, help="Print " "copious amounts of text.") parser.add_argument('--first-run', dest='FIRST_RUN', action='store_true', default=False, help="Ignore " "all change delta thresholds.") nas = parser.parse_args(sys.argv[1:]) b = DNSBuilder(**dict(nas._get_kwargs())) try: b.build_dns() except BuildError as why: b.log('LOG_ERR', why) #fail_mail(message.format(why)) except Exception as err: # Make some noise #fail_mail(message.format(err)) b.log('LOG_CRIT', err) raise