Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding debug option to manage_nsfs #8156

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cmd/manage_nsfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ async function main(argv = minimist(process.argv.slice(2))) {
if (process.getuid() !== 0 || process.getgid() !== 0) {
throw new Error('Root permissions required for Manage NSFS execution.');
}
if (argv.debug) {
const debug_level = Number(argv.debug) || 5;
dbg.set_module_level(debug_level, 'core');
nb_native().fs.set_debug_level(debug_level);
}
const type = argv._[0] || '';
const action = argv._[1] || '';
if (argv.help || argv.h) {
Expand Down
5 changes: 3 additions & 2 deletions src/manage_nsfs/manage_nsfs_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CONFIG_SUBDIRS = {
};

const GLOBAL_CONFIG_ROOT = 'config_root';
const GLOBAL_CONFIG_OPTIONS = new Set([GLOBAL_CONFIG_ROOT, 'config_root_backend']);
const GLOBAL_CONFIG_OPTIONS = new Set([GLOBAL_CONFIG_ROOT, 'config_root_backend', 'debug']);
const FROM_FILE = 'from_file';
const ANONYMOUS = 'anonymous';

Expand Down Expand Up @@ -107,7 +107,8 @@ const OPTION_TYPE = {
deployment_type: 'string',
all_account_details: 'boolean',
all_bucket_details: 'boolean',
https_port: 'number'
https_port: 'number',
debug: 'number',
};

const BOOLEAN_STRING_VALUES = ['true', 'false'];
Expand Down
1 change: 1 addition & 0 deletions src/manage_nsfs/manage_nsfs_help_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Flags:
const GLOBAL_CONFIG_ROOT_ALL_FLAG = `
--config_root <string> (optional) Use configuration files path (default config.NSFS_NC_DEFAULT_CONF_DIR)
--config_root_backend <none | GPFS | CEPH_FS | NFSv4> (optional) Use the filesystem type in the configuration (default config.NSFS_NC_CONFIG_DIR_BACKEND)
--debug <number> (optional) Use for increasing the log verbosity of cli commands
`;

const ACCOUNT_FLAGS_ADD = `
Expand Down