Exemplo n.º 1
0
def get_config(lib_env):
    """
    Returns ACL configuration in dictionary. Format of output:
        {
            "target_list": <list of targets>,
            "group_list": <list og groups>,
            "role_list": <list of roles>,
        }

    lib_env -- LibraryEnvironment
    """
    acl_section = get_acls(lib_env.get_cib(REQUIRED_CIB_VERSION))
    return {
        "target_list": acl.get_target_list(acl_section),
        "group_list": acl.get_group_list(acl_section),
        "role_list": acl.get_role_list(acl_section),
    }
Exemplo n.º 2
0
def get_config(lib_env):
    """
    Returns ACL configuration in disctionary. Fromat of output:
        {
            "target_list": <list of targets>,
            "group_list": <list og groups>,
            "role_list": <list of roles>,
        }

    lib_env -- LibraryEnvironment
    """
    cib = lib_env.get_cib(REQUIRED_CIB_VERSION)
    return {
        "target_list": acl.get_target_list(cib),
        "group_list": acl.get_group_list(cib),
        "role_list": acl.get_role_list(cib),
    }
Exemplo n.º 3
0
 def test_success(self, mock_fn):
     mock_fn.return_value = "returned data"
     self.assertEqual("returned data", lib.get_group_list("tree"))
     mock_fn.assert_called_once_with("tree", "acl_group")
Exemplo n.º 4
0
 def test_success(self, mock_fn):
     mock_fn.return_value = "returned data"
     self.assertEqual("returned data", lib.get_group_list("tree"))
     mock_fn.assert_called_once_with("tree", "acl_group")