From 3a6b230339a4530db0ff187521fc0549914535c7 Mon Sep 17 00:00:00 2001 From: Amit Prinz Setter Date: Mon, 29 Jul 2024 10:37:54 -0700 Subject: [PATCH] NC | account by id | various fixes -fix account status name flag check -fix Getting Started diagram url -return email to nc coretest rpc -fix has_access_keys() to check access_keys[0].access_key is defined --- docs/NooBaaNonContainerized/GettingStarted.md | 2 +- src/cmd/manage_nsfs.js | 2 +- src/manage_nsfs/manage_nsfs_cli_utils.js | 2 +- src/test/unit_tests/nc_coretest.js | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/NooBaaNonContainerized/GettingStarted.md b/docs/NooBaaNonContainerized/GettingStarted.md index 4a0af6639c..706605f91d 100644 --- a/docs/NooBaaNonContainerized/GettingStarted.md +++ b/docs/NooBaaNonContainerized/GettingStarted.md @@ -31,7 +31,7 @@ NooBaa Non Containerized solution includes the following components - 5. [Storage File System](#create-storage-file-system-paths) - A File system for storing objects. ### NooBaa High Level Diagram -![NooBaa Non Containerized Components Diagram](https://private-user-images.githubusercontent.com/7504055/351399903-4ee60215-cb4f-48f7-8943-a85dc7f931aa.png) +![NooBaa Non Containerized Components Diagram](https://github.com/user-attachments/assets/601a6220-f236-446e-9ead-404d41a5ffc5) ## Build NooBaa RPM diff --git a/src/cmd/manage_nsfs.js b/src/cmd/manage_nsfs.js index 69b0eaf7f8..3415b4715f 100644 --- a/src/cmd/manage_nsfs.js +++ b/src/cmd/manage_nsfs.js @@ -597,7 +597,7 @@ async function delete_account(data, user_input) { async function get_account_status(data, user_input, show_secrets) { await manage_nsfs_validations.validate_account_args(global_config, data, ACTIONS.STATUS, undefined); try { - const account_path = _.isUndefined(data.name) ? + const account_path = _.isUndefined(user_input.name) ? get_symlink_config_file_path(global_config.access_keys_dir_path, data.access_keys[0].access_key) : //user_input.name is root account name. data.name is iam account name get_symlink_config_file_path(global_config.root_accounts_dir_path, data.name, user_input.name); diff --git a/src/manage_nsfs/manage_nsfs_cli_utils.js b/src/manage_nsfs/manage_nsfs_cli_utils.js index 301c3e4ded..d7831f5985 100644 --- a/src/manage_nsfs/manage_nsfs_cli_utils.js +++ b/src/manage_nsfs/manage_nsfs_cli_utils.js @@ -191,7 +191,7 @@ async function get_options_from_file(file_path) { * @param {object[]} access_keys */ function has_access_keys(access_keys) { - return access_keys.length > 0; + return access_keys.length > 0 && access_keys[0].access_key; } /** diff --git a/src/test/unit_tests/nc_coretest.js b/src/test/unit_tests/nc_coretest.js index 5a694dbf54..22a2156b4b 100644 --- a/src/test/unit_tests/nc_coretest.js +++ b/src/test/unit_tests/nc_coretest.js @@ -282,6 +282,10 @@ async function read_bucket_manage(options) { const res = await exec_manage_cli(TYPES.BUCKET, ACTIONS.STATUS, options); const json_bucket = JSON.parse(res); const bucket = json_bucket.response.reply; + bucket.owner_account = { + email: bucket.bucket_owner, + id: bucket.owner_account + }; return bucket; }