Beispiel #1
0
 def test_success(self):
     lib.remove_group(self.cib.tree, "group1")
     self.assert_cib_equal(self.create_cib().append_to_first_tag_name(
         "configuration", """
         <acls>
             <acl_role id="group2"/>
         </acls>
         """))
Beispiel #2
0
def remove_group(lib_env, group_id):
    """
    Remove acl_group element with id group_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    group_id -- id of group which should be removed
    """
    with cib_acl_section(lib_env) as acl_section:
        acl.remove_group(acl_section, group_id)
Beispiel #3
0
 def test_success(self):
     lib.remove_group(self.cib.tree, "group1")
     self.assert_cib_equal(self.create_cib().append_to_first_tag_name(
         "configuration",
         """
         <acls>
             <acl_role id="group2"/>
         </acls>
         """
     ))
Beispiel #4
0
def remove_group(lib_env, group_id):
    """
    Remove acl_group element with id group_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    group_id -- id of group which should be removed
    """
    with cib_acl_section(lib_env) as acl_section:
        acl.remove_group(acl_section, group_id)
Beispiel #5
0
def remove_group(lib_env, group_id):
    """
    Remove acl_group element with id group_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    group_id -- id of group which should be removed
    """
    cib = lib_env.get_cib(REQUIRED_CIB_VERSION)
    acl.remove_group(cib, group_id)
    lib_env.push_cib(cib)
Beispiel #6
0
def remove_group(lib_env, group_id):
    """
    Remove acl_group element with id group_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    group_id -- id of group which should be removed
    """
    cib = lib_env.get_cib(REQUIRED_CIB_VERSION)
    acl.remove_group(cib, group_id)
    lib_env.push_cib(cib)
Beispiel #7
0
 def test_not_existing(self):
     assert_raise_library_error(
         lambda: lib.remove_group(self.cib.tree, "group2"),
         (severities.ERROR, report_codes.ID_BELONGS_TO_UNEXPECTED_TYPE, {
             "id": "group2",
             "expected_types": ["acl_group"],
             "current_type": "acl_role",
         }))
Beispiel #8
0
 def test_not_existing(self):
     assert_raise_library_error(
         lambda: lib.remove_group(self.cib.tree, "group2"),
         (
             severities.ERROR,
             report_codes.ID_NOT_FOUND,
             {"id": "group2"}
         )
     )
Beispiel #9
0
 def test_not_existing(self):
     assert_raise_library_error(
         lambda: lib.remove_group(self.cib.tree, "group2"),
         (
             severities.ERROR,
             report_codes.ID_BELONGS_TO_UNEXPECTED_TYPE,
             {
                 "id": "group2",
                 "expected_types": ["acl_group"],
                 "current_type": "acl_role",
             }
         )
     )