Exemplo n.º 1
0
def check_read_netns():
    required = checks.netns_read_requires_helper()
    if not required and cfg.CONF.AGENT.use_helper_for_ns_read:
        LOG.warning(_LW("The user that is executing neutron can read the "
                        "namespaces without using the root_helper. Disable "
                        "the use_helper_for_ns_read option to avoid a "
                        "performance impact."))
        # Don't fail because nothing is actually broken. Just not optimal.
        result = True
    elif required and not cfg.CONF.AGENT.use_helper_for_ns_read:
        LOG.error(_LE("The user that is executing neutron does not have "
                      "permissions to read the namespaces. Enable the "
                      "use_helper_for_ns_read configuration option."))
        result = False
    else:
        # everything is configured appropriately
        result = True
    return result
Exemplo n.º 2
0
def check_read_netns():
    required = checks.netns_read_requires_helper()
    if not required and cfg.CONF.AGENT.use_helper_for_ns_read:
        LOG.warning("The user that is executing neutron can read the "
                    "namespaces without using the root_helper. Disable "
                    "the use_helper_for_ns_read option to avoid a "
                    "performance impact.")
        # Don't fail because nothing is actually broken. Just not optimal.
        result = True
    elif required and not cfg.CONF.AGENT.use_helper_for_ns_read:
        LOG.error("The user that is executing neutron does not have "
                  "permissions to read the namespaces. Enable the "
                  "use_helper_for_ns_read configuration option.")
        result = False
    else:
        # everything is configured appropriately
        result = True
    return result
Exemplo n.º 3
0
 def test_namespace_root_read_detection_runs(self):
     checks.netns_read_requires_helper(self.root_helper)
Exemplo n.º 4
0
 def test_namespace_root_read_detection_runs(self):
     checks.netns_read_requires_helper()