From f0cbf9c30134fcdba0975e57cada9dc452c479cd Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Thu, 14 Nov 2024 15:35:13 +0300 Subject: [PATCH] [#180] preset_grpc: Remove deprecated parameter `acl` Signed-off-by: Anton Nikiforov --- README.md | 2 +- examples/native.js | 1 - internal/native/client.go | 11 ----------- scenarios/preset/helpers/frostfs_cli.py | 8 +++----- scenarios/preset/preset_grpc.py | 3 +-- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 20206d0..1bd1034 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ const frostfs_cli = native.connect("s01.frostfs.devenv:8080", "", 0, 0, false, 0 ### Methods - `putContainer(params)`. The `params` is a dictionary (e.g. - `{acl:'public-read-write',placement_policy:'REP 3',name:'container-name',name_global_scope:'false'}`). + `{placement_policy:'REP 3',name:'container-name',name_global_scope:'false'}`). Returns dictionary with `success` boolean flag, `container_id` string, and `error` string. - `setBufferSize(size)`. Sets internal buffer size for data upload and diff --git a/examples/native.js b/examples/native.js index d971909..7764fec 100644 --- a/examples/native.js +++ b/examples/native.js @@ -13,7 +13,6 @@ export const options = { export function setup() { const params = { - acl: 'public-read-write', placement_policy: 'REP 3', name: 'container-name', name_global_scope: 'false' diff --git a/internal/native/client.go b/internal/native/client.go index d8fa518..f4fd225 100644 --- a/internal/native/client.go +++ b/internal/native/client.go @@ -13,7 +13,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" - "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" @@ -265,16 +264,6 @@ func (c *Client) PutContainer(params map[string]string) PutContainerResponse { container.SetCreationTime(&cnr, time.Now()) cnr.SetOwner(usr) - if basicACLStr, ok := params["acl"]; ok { - var basicACL acl.Basic - err := basicACL.DecodeString(basicACLStr) - if err != nil { - return c.putCnrErrorResponse(err) - } - - cnr.SetBasicACL(basicACL) - } - placementPolicyStr, ok := params["placement_policy"] if ok { var placementPolicy netmap.PlacementPolicy diff --git a/scenarios/preset/helpers/frostfs_cli.py b/scenarios/preset/helpers/frostfs_cli.py index 01b4aaf..116a797 100644 --- a/scenarios/preset/helpers/frostfs_cli.py +++ b/scenarios/preset/helpers/frostfs_cli.py @@ -1,7 +1,7 @@ import re from helpers.cmd import execute_cmd, log -def create_container(endpoint, policy, container_creation_retry, wallet_path, config, acl, local=False, retry=0): +def create_container(endpoint, policy, container_creation_retry, wallet_path, config, local=False, retry=0): if retry > int(container_creation_retry): raise ValueError(f"unable to create container: too many unsuccessful attempts") @@ -9,10 +9,8 @@ def create_container(endpoint, policy, container_creation_retry, wallet_path, co wallet_file = f"--wallet {wallet_path}" if config: wallet_config = f"--config {config}" - if acl: - acl_param = f"--basic-acl {acl}" cmd_line = f"frostfs-cli --rpc-endpoint {endpoint} container create {wallet_file} {wallet_config} " \ - f" --policy '{policy}' {acl_param} --await" + f" --policy '{policy}' --await" output, success = execute_cmd(cmd_line) @@ -88,7 +86,7 @@ def create_container(endpoint, policy, container_creation_retry, wallet_path, co return cid log(f"Created container {cid} is not stored on {endpoint}, creating another one...", endpoint) - return create_container(endpoint, policy, container_creation_retry, wallet_path, config, acl, local, retry + 1) + return create_container(endpoint, policy, container_creation_retry, wallet_path, config, local, retry + 1) def upload_object(container, payload_filepath, endpoint, wallet_file, wallet_config): diff --git a/scenarios/preset/preset_grpc.py b/scenarios/preset/preset_grpc.py index 565e63a..fbec2e3 100755 --- a/scenarios/preset/preset_grpc.py +++ b/scenarios/preset/preset_grpc.py @@ -37,7 +37,6 @@ parser.add_argument('--workers', help='Count of workers in preset. Max = 50, Def parser.add_argument('--sleep', help='Time to sleep between containers creation and objects upload (in seconds), ' 'Default = 8', default=8) parser.add_argument('--local', help='Create containers that store data on provided endpoints. Warning: additional empty containers may be created.', action='store_true') -parser.add_argument('--acl', help='Container ACL. Default is public-read-write.', default='public-read-write') args: Namespace = parser.parse_args() print(args) @@ -68,7 +67,7 @@ def main(): containers_count = int(args.containers) print(f"Create containers: {containers_count}") with ProcessPoolExecutor(max_workers=min(MAX_WORKERS, workers)) as executor: - containers_runs = [executor.submit(create_container, endpoint, policy, container_creation_retry, wallet, wallet_config, args.acl, args.local) + containers_runs = [executor.submit(create_container, endpoint, policy, container_creation_retry, wallet, wallet_config, args.local) for _, endpoint, policy in zip(range(containers_count), cycle(endpoints), cycle(args.policy))]