Exemplo n.º 1
0
def reloadAll(update):
    """
    Reload pdconf configuration files.
    """
    # Note: reloading all config files at once seems safer than individual
    # files because of cross-dependencies.
    statusString = client.reloadAll()

    # Check the status to make sure all configuration sections
    # related to this chute were successfully loaded.
    #
    # We should only abort if there were problems related to this chute.
    # Example: a WiFi card was removed, so we fail to bring up old WiFi
    # interfaces; however, installing a new chute that does not depend on WiFi
    # should still succeed.
    status = json.loads(statusString)
    for section in status:
        # Checking age > 0 filters out errors that occurred in the past.
        if section['success'] or section['age'] > 0:
            continue

        message = "Error installing configuration section {} {} for chute {}".format(
                section['type'], section['name'], section['comment'])
        if section['comment'] == update.new.name:
            raise Exception(message)
        else:
            out.warn(message)
Exemplo n.º 2
0
def reloadAll(update):
    """
    Reload pdconf configuration files.
    """
    # Note: reloading all config files at once seems safer than individual
    # files because of cross-dependencies.
    statusString = client.reloadAll()

    # Check the status to make sure all configuration sections
    # related to this chute were successfully loaded.
    #
    # We should only abort if there were problems related to this chute.
    # Example: a WiFi card was removed, so we fail to bring up old WiFi
    # interfaces; however, installing a new chute that does not depend on WiFi
    # should still succeed.
    status = json.loads(statusString)
    for section in status:
        # Checking age > 0 filters out errors that occurred in the past.
        if section['success'] or section['age'] > 0:
            continue

        message = "Error installing configuration section {} {} for chute {}".format(
            section['type'], section['name'], section['comment'])
        if section['comment'] == update.new.name:
            raise Exception(message)
        else:
            out.warn(message)
Exemplo n.º 3
0
    def pdconf_reload(self, request):
        """
        Trigger pdconf to reload UCI configuration files.

        Trigger pdconf to reload UCI configuration files and return the status.
        This function is intended for low-level debugging of the paradrop
        pdconf module.
        """
        cors.config_cors(request)
        request.setHeader('Content-Type', 'application/json')
        return pdconf_client.reloadAll()
Exemplo n.º 4
0
    def pdconf_reload(self, request):
        """
        Trigger pdconf to reload UCI configuration files.

        Trigger pdconf to reload UCI configuration files and return the status.
        This function is intended for low-level debugging of the paradrop
        pdconf module.
        """
        cors.config_cors(request)
        request.setHeader('Content-Type', 'application/json')
        return pdconf_client.reloadAll()