* New method: access_group_destroy(ag_name) Delete a access group including it's initiator and volume masking status. No error will be raised even provided access group name does not exist. Parameters: ag_name (str): Access group name Returns: N/A Errors: N/A
Signed-off-by: Gris Ge fge@redhat.com --- API.md | 10 ++++++++++ targetd/block.py | 6 ++++++ 2 files changed, 16 insertions(+)
diff --git a/API.md b/API.md index cb737b3..214f636 100644 --- a/API.md +++ b/API.md @@ -165,6 +165,16 @@ Errors: -50: Name conflict. Requested 'ag_name' is in use -52: Exists initiator. Requested 'init_id' is in use
+### access_group_destroy(ag_name) +Delete a access group including it's initiator and volume masking status. +No error will be raised even provided access group name does not exist. +Parameters: + ag_name (str): Access group name +Returns: + N/A +Errors: + N/A + File system operations ---------------------- Ability to create different file systems and perform operation on them. The diff --git a/targetd/block.py b/targetd/block.py index 71c843b..e834a09 100644 --- a/targetd/block.py +++ b/targetd/block.py @@ -109,6 +109,7 @@ def initialize(config_dict): initiator_list=initiator_list, access_group_list=access_group_list, access_group_create=access_group_create, + access_group_destroy=access_group_destroy, )
@@ -427,3 +428,8 @@ def access_group_create(req, ag_name, init_id, init_type): node_acl_group = NodeACLGroup(tpg, ag_name) node_acl_group.add_acl(init_id) RTSRoot().save_to_file() + + +def access_group_destroy(req, ag_name): + NodeACLGroup(_get_iscsi_tpg(), ag_name).delete() + RTSRoot().save_to_file()