rpc: Rename delete_secret_from_iscsi_auth_group to iscsi_auth_group_remove_secret
Change-Id: I914c930914931f1356cd1ae9fb6a8eb4ff6a85b1 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468487 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
61f4433c20
commit
a25f9bf94a
@ -2886,9 +2886,9 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
## delete_secret_from_iscsi_auth_group {#rpc_delete_secret_from_iscsi_auth_group}
|
||||
## iscsi_auth_group_remove_secret {#rpc_iscsi_auth_group_remove_secret}
|
||||
|
||||
Delete a secret from an existing authentication group for CHAP authentication.
|
||||
Remove a secret from an existing authentication group for CHAP authentication.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -2908,7 +2908,7 @@ Example request:
|
||||
"user": "u3"
|
||||
},
|
||||
"jsonrpc": "2.0",
|
||||
"method": "delete_secret_from_iscsi_auth_group",
|
||||
"method": "iscsi_auth_group_remove_secret",
|
||||
"id": 1
|
||||
}
|
||||
~~~
|
||||
|
@ -1416,37 +1416,37 @@ SPDK_RPC_REGISTER("iscsi_auth_group_add_secret", spdk_rpc_iscsi_auth_group_add_s
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_auth_group_add_secret, add_secret_to_iscsi_auth_group)
|
||||
|
||||
|
||||
struct rpc_delete_auth_secret {
|
||||
struct rpc_remove_auth_secret {
|
||||
int32_t tag;
|
||||
char *user;
|
||||
};
|
||||
|
||||
static void
|
||||
free_rpc_delete_auth_secret(struct rpc_delete_auth_secret *_secret)
|
||||
free_rpc_remove_auth_secret(struct rpc_remove_auth_secret *_secret)
|
||||
{
|
||||
free(_secret->user);
|
||||
}
|
||||
|
||||
static const struct spdk_json_object_decoder rpc_delete_auth_secret_decoders[] = {
|
||||
{"tag", offsetof(struct rpc_delete_auth_secret, tag), spdk_json_decode_int32},
|
||||
{"user", offsetof(struct rpc_delete_auth_secret, user), spdk_json_decode_string},
|
||||
static const struct spdk_json_object_decoder rpc_remove_auth_secret_decoders[] = {
|
||||
{"tag", offsetof(struct rpc_remove_auth_secret, tag), spdk_json_decode_int32},
|
||||
{"user", offsetof(struct rpc_remove_auth_secret, user), spdk_json_decode_string},
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_delete_secret_from_iscsi_auth_group(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
spdk_rpc_iscsi_auth_group_remove_secret(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_delete_auth_secret req = {};
|
||||
struct rpc_remove_auth_secret req = {};
|
||||
struct spdk_json_write_ctx *w;
|
||||
struct spdk_iscsi_auth_group *group;
|
||||
int rc;
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_delete_auth_secret_decoders,
|
||||
SPDK_COUNTOF(rpc_delete_auth_secret_decoders), &req)) {
|
||||
if (spdk_json_decode_object(params, rpc_remove_auth_secret_decoders,
|
||||
SPDK_COUNTOF(rpc_remove_auth_secret_decoders), &req)) {
|
||||
SPDK_ERRLOG("spdk_json_decode_object failed\n");
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
"Invalid parameters");
|
||||
free_rpc_delete_auth_secret(&req);
|
||||
free_rpc_remove_auth_secret(&req);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1458,7 +1458,7 @@ spdk_rpc_delete_secret_from_iscsi_auth_group(struct spdk_jsonrpc_request *reques
|
||||
|
||||
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
"Could not find auth group (%d)", req.tag);
|
||||
free_rpc_delete_auth_secret(&req);
|
||||
free_rpc_remove_auth_secret(&req);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1469,20 +1469,22 @@ spdk_rpc_delete_secret_from_iscsi_auth_group(struct spdk_jsonrpc_request *reques
|
||||
spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
|
||||
"Could not delete secret from CHAP group (%d), %s",
|
||||
req.tag, spdk_strerror(-rc));
|
||||
free_rpc_delete_auth_secret(&req);
|
||||
free_rpc_remove_auth_secret(&req);
|
||||
return;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_spdk_iscsi.mutex);
|
||||
|
||||
free_rpc_delete_auth_secret(&req);
|
||||
free_rpc_remove_auth_secret(&req);
|
||||
|
||||
w = spdk_jsonrpc_begin_result(request);
|
||||
spdk_json_write_bool(w, true);
|
||||
spdk_jsonrpc_end_result(request, w);
|
||||
}
|
||||
SPDK_RPC_REGISTER("delete_secret_from_iscsi_auth_group",
|
||||
spdk_rpc_delete_secret_from_iscsi_auth_group, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER("iscsi_auth_group_remove_secret",
|
||||
spdk_rpc_iscsi_auth_group_remove_secret, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_auth_group_remove_secret,
|
||||
delete_secret_from_iscsi_auth_group)
|
||||
|
||||
static void
|
||||
spdk_rpc_iscsi_get_auth_groups(struct spdk_jsonrpc_request *request,
|
||||
|
@ -790,13 +790,14 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
p.add_argument('-r', '--msecret', help='Secret for mutual CHAP authentication')
|
||||
p.set_defaults(func=iscsi_auth_group_add_secret)
|
||||
|
||||
def delete_secret_from_iscsi_auth_group(args):
|
||||
rpc.iscsi.delete_secret_from_iscsi_auth_group(args.client, tag=args.tag, user=args.user)
|
||||
def iscsi_auth_group_remove_secret(args):
|
||||
rpc.iscsi.iscsi_auth_group_remove_secret(args.client, tag=args.tag, user=args.user)
|
||||
|
||||
p = subparsers.add_parser('delete_secret_from_iscsi_auth_group', help='Delete a secret from an authentication group.')
|
||||
p = subparsers.add_parser('iscsi_auth_group_remove_secret', aliases=['delete_secret_from_iscsi_auth_group'],
|
||||
help='Remove a secret from an authentication group.')
|
||||
p.add_argument('tag', help='Authentication group tag', type=int)
|
||||
p.add_argument('-u', '--user', help='User name for one-way CHAP authentication', required=True)
|
||||
p.set_defaults(func=delete_secret_from_iscsi_auth_group)
|
||||
p.set_defaults(func=iscsi_auth_group_remove_secret)
|
||||
|
||||
def iscsi_get_auth_groups(args):
|
||||
print_dict(rpc.iscsi.iscsi_get_auth_groups(args.client))
|
||||
|
@ -323,8 +323,9 @@ def iscsi_auth_group_add_secret(client, tag, user, secret, muser=None, msecret=N
|
||||
return client.call('iscsi_auth_group_add_secret', params)
|
||||
|
||||
|
||||
def delete_secret_from_iscsi_auth_group(client, tag, user):
|
||||
"""Delete a secret from an authentication group.
|
||||
@deprecated_alias('delete_secret_from_iscsi_auth_group')
|
||||
def iscsi_auth_group_remove_secret(client, tag, user):
|
||||
"""Remove a secret from an authentication group.
|
||||
|
||||
Args:
|
||||
tag: Authentication group tag (unique, integer > 0)
|
||||
@ -334,7 +335,7 @@ def delete_secret_from_iscsi_auth_group(client, tag, user):
|
||||
True or False
|
||||
"""
|
||||
params = {'tag': tag, 'user': user}
|
||||
return client.call('delete_secret_from_iscsi_auth_group', params)
|
||||
return client.call('iscsi_auth_group_remove_secret', params)
|
||||
|
||||
|
||||
@deprecated_alias('delete_pg_ig_maps')
|
||||
|
@ -526,7 +526,7 @@ class UIISCSIAuthGroups(UINode):
|
||||
self.get_root().iscsi_delete_auth_group(tag=tag)
|
||||
|
||||
def delete_secret(self, tag, user):
|
||||
self.get_root().delete_secret_from_iscsi_auth_group(
|
||||
self.get_root().iscsi_auth_group_remove_secret(
|
||||
tag=tag, user=user)
|
||||
|
||||
def ui_command_create(self, tag, secrets=None):
|
||||
|
@ -448,8 +448,8 @@ class UIRoot(UINode):
|
||||
rpc.iscsi.iscsi_auth_group_add_secret(self.client, **kwargs)
|
||||
|
||||
@verbose
|
||||
def delete_secret_from_iscsi_auth_group(self, **kwargs):
|
||||
rpc.iscsi.delete_secret_from_iscsi_auth_group(self.client, **kwargs)
|
||||
def iscsi_auth_group_remove_secret(self, **kwargs):
|
||||
rpc.iscsi.iscsi_auth_group_remove_secret(self.client, **kwargs)
|
||||
|
||||
@verbose
|
||||
@is_method_available
|
||||
|
Loading…
Reference in New Issue
Block a user