예제 #1
0
파일: main.py 프로젝트: openstack/freezer
def main():
    """freezer-agent binary main execution"""
    backup_args = None
    try:

        freezer_config.config(args=sys.argv[1:])
        freezer_config.setup_logging()
        backup_args = freezer_config.get_backup_args()
        if backup_args.config:
            # reload logging configuration to force oslo use the new log path
            if backup_args.log_config_append:
                CONF.set_override('log_config_append',
                                  backup_args.log_config_append)

            freezer_config.setup_logging()

        if len(sys.argv) < 2:
            CONF.print_help()
            sys.exit(1)
        freezer_main(backup_args)

    except Exception as err:
        quiet = backup_args.quiet if backup_args else False
        LOG.exception(err)
        LOG.critical("Run freezer agent process unsuccessfully")
        return fail(1, err, quiet)
예제 #2
0
파일: main.py 프로젝트: szaher/freezer
def main():
    """freezer-agent binary main execution"""
    backup_args = None
    try:

        freezer_config.config(args=sys.argv[1:])
        freezer_config.setup_logging()
        backup_args = freezer_config.get_backup_args()
        if backup_args.config:
            # reload logging configuration to force oslo use the new log path
            if backup_args.log_config_append:
                CONF.set_override('log_config_append',
                                  backup_args.log_config_append)

            freezer_config.setup_logging()

        if len(sys.argv) < 2:
            CONF.print_help()
            sys.exit(1)
        freezer_main(backup_args)

    except Exception as err:
        quiet = backup_args.quiet if backup_args else False
        LOG.exception(err)
        LOG.critical("End freezer agent process unsuccessfully")
        return fail(1, err, quiet)
예제 #3
0
    def setUp(self):
        if six.PY34:
            super().setUp()
        else:
            super(FreezerBaseTestCase, self).setUp()

        self._config_fixture = self.useFixture(cfg_fixture.Config())
        config.config(args=[])
        self.addCleanup(CONF.reset)
예제 #4
0
파일: main.py 프로젝트: gongwayne/Openstack
def main():
    """freezer-agent/freezerc binary main execution"""
    try:
        freezer_config.config()
        freezer_config.setup_logging()
        backup_args = freezer_config.get_backup_args()
        if len(sys.argv) < 2:
            CONF.print_help()
            sys.exit(1)
        freezer_main(backup_args)
    except Exception as err:
        return fail(1, err, backup_args.quiet)
예제 #5
0
def main():
    """freezer-agent binary main execution"""
    backup_args = None
    try:
        freezer_config.config()
        freezer_config.setup_logging()
        backup_args = freezer_config.get_backup_args()
        if len(sys.argv) < 2:
            CONF.print_help()
            sys.exit(1)
        freezer_main(backup_args)
    except Exception as err:
        quiet = backup_args.quiet if backup_args else False
        return fail(1, err, quiet)
예제 #6
0
파일: main.py 프로젝트: popawu/freezer
def main():
    """freezer-agent binary main execution"""
    backup_args = None
    try:
        freezer_config.config()
        freezer_config.setup_logging()
        backup_args = freezer_config.get_backup_args()
        if backup_args.config:
            # reload logging configuration to force oslo use the new log path
            freezer_config.setup_logging()

        if len(sys.argv) < 2:
            CONF.print_help()
            sys.exit(1)
        freezer_main(backup_args)
    except Exception as err:
        quiet = backup_args.quiet if backup_args else False
        return fail(1, err, quiet)
예제 #7
0
    def setUp(self):
        super(FreezerBaseTestCase, self).setUp()

        self._config_fixture = self.useFixture(cfg_fixture.Config())
        config.config(args=[])
        self.addCleanup(CONF.reset)