Skip to content

Commit eb6aaa6

Browse files
committed
NC | NSFS | Update fetch_existing_account_data
1. In the past, for accout update the identifier could be name or access_key, but today it is only name. Therefore, suggesting to remove the other option (get_account_by_access_key ) as it will always use get_account_by_name. Signed-off-by: shirady <[email protected]>
1 parent 68a0cc7 commit eb6aaa6

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/cmd/manage_nsfs.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -352,17 +352,11 @@ async function fetch_existing_account_data(action, target, decrypt_secret_key) {
352352
const options = { show_secrets: true, decrypt_secret_key };
353353
let source;
354354
try {
355-
source = target.name ?
356-
await config_fs.get_account_by_name(target.name, options) :
357-
await config_fs.get_account_by_access_key(target.access_keys[0].access_key, options);
355+
source = await config_fs.get_account_by_name(target.name, options);
358356
} catch (err) {
359-
dbg.log1('NSFS Manage command: Could not find account', target, err);
357+
dbg.warn('fetch_existing_account_data: got an error on', target.name, err);
360358
if (err.code === 'ENOENT') {
361-
if (target.name === undefined) {
362-
throw_cli_error(ManageCLIError.NoSuchAccountAccessKey, target.access_keys[0].access_key);
363-
} else {
364-
throw_cli_error(ManageCLIError.NoSuchAccountName, target.name);
365-
}
359+
throw_cli_error(ManageCLIError.NoSuchAccountName, target.name);
366360
}
367361
throw err;
368362
}

0 commit comments

Comments
 (0)