示例#1
0
def add_patches():
    add_patches_to_twisted()
    fix_django_deferred_attribute()
    fix_piston_emitter_related()
    fix_piston_consumer_delete()
    fix_ordereddict_yaml_representer()
    fix_twisted_disconnect_write()
示例#2
0
文件: plugin.py 项目: tjjh89017/maas
    def makeService(self, options, clock=reactor):
        """Construct the MAAS Cluster service."""
        register_sigusr1_toggle_cprofile('rackd')
        register_sigusr2_thread_dump_handler()
        clean_prometheus_dir()
        add_patches_to_txtftp()
        add_patches_to_twisted()

        self._loadSettings()
        self._configureCrochet()
        if settings.DEBUG:
            # Always log at debug level in debug mode.
            self._configureLogging(3)
        else:
            self._configureLogging(options["verbosity"])

        with ClusterConfiguration.open() as config:
            tftp_root = config.tftp_root
            tftp_port = config.tftp_port

        from provisioningserver import services
        for service in self._makeServices(tftp_root, tftp_port, clock=clock):
            service.setServiceParent(services)

        return services
示例#3
0
    def makeService(self, options, clock=reactor):
        """Construct the MAAS Cluster HTTP service."""
        register_sigusr2_thread_dump_handler()
        add_patches_to_twisted()

        self._loadSettings()
        if settings.DEBUG:
            # Always log at debug level in debug mode.
            self._configureLogging(3)
        else:
            self._configureLogging(options["verbosity"])

        with ClusterConfiguration.open() as config:
            tftp_root = config.tftp_root

        return self._makeHTTPService(5248, tftp_root, 'images')
示例#4
0
    def makeService(self, options, clock=reactor):
        """Construct the MAAS Cluster service."""
        register_sigusr2_thread_dump_handler()
        add_patches_to_txtftp()
        add_patches_to_twisted()

        self._configureCrochet()
        self._configureLogging(options["verbosity"])

        with ClusterConfiguration.open() as config:
            tftp_root = config.tftp_root
            tftp_port = config.tftp_port

        from provisioningserver import services
        for service in self._makeServices(tftp_root, tftp_port, clock=clock):
            service.setServiceParent(services)

        return services
示例#5
0
    def makeService(self, options, clock=reactor, sleep=sleep):
        """Construct the MAAS Cluster service."""
        register_sigusr1_toggle_cprofile("rackd")
        register_sigusr2_thread_dump_handler()
        clean_prometheus_dir()
        add_patches_to_txtftp()
        add_patches_to_twisted()

        self._loadSettings()
        self._configureCrochet()
        if settings.DEBUG:
            # Always log at debug level in debug mode.
            self._configureLogging(3)
        else:
            self._configureLogging(options["verbosity"])

        with ClusterConfiguration.open() as config:
            tftp_root = config.tftp_root
            tftp_port = config.tftp_port

        from provisioningserver import services

        secret = None
        for elapsed, remaining, wait in retries(timeout=5 * 60, clock=clock):
            secret = get_shared_secret_from_filesystem()
            if secret is not None:
                break
            sleep(wait)
        if secret is not None:
            # only setup services if the shared secret is configured
            for service in self._makeServices(tftp_root,
                                              tftp_port,
                                              clock=clock):
                service.setServiceParent(services)

            reactor.callInThread(generate_certificate_if_needed)

        return services
示例#6
0
def add_patches():
    add_patches_to_twisted()
    fix_django_http_request()
    fix_piston_emitter_related()
示例#7
0
文件: monkey.py 项目: pfxuan/maas
def add_patches():
    add_patches_to_twisted()
    fix_django_http_request()
    fix_piston_emitter_related()
    fix_piston_consumer_delete()
    fix_ordereddict_yaml_representer()