Skip to content

Commit 458db8b

Browse files
author
Fred Sung
committed
MAGETWO-36367: Fix Messages in Setup CLI Commands
- Specify require options - Remove the default value of empty string for admin-password
1 parent 397806c commit 458db8b

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

setup/src/Magento/Setup/Console/Command/AbstractMaintenanceCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configure()
5353
self::INPUT_KEY_IP,
5454
null,
5555
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
56-
'Allowed IP addresses'
56+
'Allowed IP addresses (use none to clear allowed IP list)'
5757
),
5858
];
5959
$this->setDefinition($options);

setup/src/Magento/Setup/Console/Command/AdminUserCreateCommand.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
7575
public function getOptionsList()
7676
{
7777
return [
78-
new InputOption(AdminAccount::KEY_USER, null, InputOption::VALUE_REQUIRED, 'Admin user'),
79-
new InputOption(AdminAccount::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, 'Admin password', ''),
80-
new InputOption(AdminAccount::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, 'Admin email'),
81-
new InputOption(AdminAccount::KEY_FIRST_NAME, null, InputOption::VALUE_REQUIRED, 'Admin first name'),
82-
new InputOption(AdminAccount::KEY_LAST_NAME, null, InputOption::VALUE_REQUIRED, 'Admin last name'),
78+
new InputOption(AdminAccount::KEY_USER, null, InputOption::VALUE_REQUIRED, '(Required) Admin user'),
79+
new InputOption(AdminAccount::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, '(Required) Admin password'),
80+
new InputOption(AdminAccount::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, '(Required) Admin email'),
81+
new InputOption(
82+
AdminAccount::KEY_FIRST_NAME,
83+
null,
84+
InputOption::VALUE_REQUIRED,
85+
'(Required) Admin first name'
86+
),
87+
new InputOption(
88+
AdminAccount::KEY_LAST_NAME,
89+
null,
90+
InputOption::VALUE_REQUIRED,
91+
'(Required) Admin last name'
92+
),
8393
];
8494
}
8595

@@ -97,7 +107,10 @@ public function validate(InputInterface $input)
97107
->setLastname($input->getOption(AdminAccount::KEY_LAST_NAME))
98108
->setUsername($input->getOption(AdminAccount::KEY_USER))
99109
->setEmail($input->getOption(AdminAccount::KEY_EMAIL))
100-
->setPassword($input->getOption(AdminAccount::KEY_PASSWORD));
110+
->setPassword(
111+
$input->getOption(AdminAccount::KEY_PASSWORD) === null
112+
? '' : $input->getOption(AdminAccount::KEY_PASSWORD)
113+
);
101114

102115
$validator = new \Magento\Framework\Validator\Object;
103116
$this->validationRules->addUserInfoRules($validator);

0 commit comments

Comments
 (0)