예제 #1
0
파일: test_acl.py 프로젝트: thulyacloud/pcs
 def test_success(self):
     lib.remove_target(self.cib.tree, "target1")
     self.assert_cib_equal(self.create_cib().append_to_first_tag_name(
         "configuration", """
         <acls>
             <acl_role id="target2"/>
         </acls>
         """))
예제 #2
0
def remove_target(lib_env, target_id):
    """
    Remove acl_target element with id target_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    target_id -- id of taget which should be removed
    """
    with cib_acl_section(lib_env) as acl_section:
        acl.remove_target(acl_section, target_id)
예제 #3
0
 def test_success(self):
     lib.remove_target(self.cib.tree, "target1")
     self.assert_cib_equal(self.create_cib().append_to_first_tag_name(
         "configuration",
         """
         <acls>
             <acl_role id="target2"/>
         </acls>
         """
     ))
예제 #4
0
파일: acl.py 프로젝트: HideoYamauchi/pcs
def remove_target(lib_env, target_id):
    """
    Remove acl_target element with id target_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    target_id -- id of taget which should be removed
    """
    with cib_acl_section(lib_env) as acl_section:
        acl.remove_target(acl_section, target_id)
예제 #5
0
def remove_target(lib_env, target_id):
    """
    Remove acl_target element with id target_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    target_id -- id of taget which should be removed
    """
    cib = lib_env.get_cib(REQUIRED_CIB_VERSION)
    acl.remove_target(cib, target_id)
    lib_env.push_cib(cib)
예제 #6
0
파일: acl.py 프로젝트: jmartign/pcs
def remove_target(lib_env, target_id):
    """
    Remove acl_target element with id target_id.
    Raises LibraryError on any failure.

    lib_env -- LibraryEnvironment
    target_id -- id of taget which should be removed
    """
    cib = lib_env.get_cib(REQUIRED_CIB_VERSION)
    acl.remove_target(cib, target_id)
    lib_env.push_cib(cib)
예제 #7
0
파일: test_acl.py 프로젝트: thulyacloud/pcs
 def test_not_existing(self):
     assert_raise_library_error(
         lambda: lib.remove_target(self.acls, "target2"),
         (severities.ERROR, report_codes.ID_BELONGS_TO_UNEXPECTED_TYPE, {
             "id": "target2",
             "expected_types": ["acl_target"],
             "current_type": "acl_role",
         }))
예제 #8
0
 def test_not_existing(self):
     assert_raise_library_error(
         lambda: lib.remove_target(self.cib.tree, "target2"),
         (
             severities.ERROR,
             report_codes.ID_NOT_FOUND,
             {"id": "target2"}
         )
     )
예제 #9
0
파일: test_acl.py 프로젝트: tomjelinek/pcs
 def test_not_existing(self):
     assert_raise_library_error(
         lambda: lib.remove_target(self.acls, "target2"),
         (
             severities.ERROR,
             report_codes.ID_BELONGS_TO_UNEXPECTED_TYPE,
             {
                 "id": "target2",
                 "expected_types": ["acl_target"],
                 "current_type": "acl_role",
             }
         )
     )