smengcl commented on a change in pull request #2857:
URL: https://github.com/apache/ozone/pull/2857#discussion_r760636232
##########
File path:
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/tenant/TenantCreateHandler.java
##########
@@ -33,26 +32,19 @@
description = "Create one or more tenants")
public class TenantCreateHandler extends TenantHandler {
- @CommandLine.Spec
- private CommandLine.Model.CommandSpec spec;
-
- @CommandLine.Parameters(description = "List of tenant names")
+ @CommandLine.Parameters(description = "List of tenant names", arity = "1..")
private List<String> tenants = new ArrayList<>();
@Override
protected void execute(OzoneClient client, OzoneAddress address) {
- if (tenants.size() > 0) {
- for (String tenantName : tenants) {
- try {
- client.getObjectStore().createTenant(tenantName);
- out().println("Created tenant '" + tenantName + "'.");
- } catch (IOException e) {
- err().println("Failed to create tenant '" + tenantName + "': " +
- e.getMessage());
- }
+ for (String tenantId : tenants) {
Review comment:
I think I will file a jira to remove the loop for create/delete tenant
CLI.
But this might actually have value for assign user to tenant? e.g. An admin
batch assigning users to a tenant without waiting for seconds every time the
Ozone CLI client's JVM boots up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]