diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-hooks.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-hooks.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.c b/xlators/mgmt/glusterd/src/glusterd-hooks.c index 569f2743dda..3e3f18959b0 100644 --- a/xlators/mgmt/glusterd/src/glusterd-hooks.c +++ b/xlators/mgmt/glusterd/src/glusterd-hooks.c @@ -162,6 +162,34 @@ glusterd_hooks_add_hooks_version (runner_t* runner) runner_argprintf (runner, "--version=%d", GLUSTERD_HOOK_VER); } +static void +glusterd_hooks_add_custom_args (dict_t *dict, runner_t *runner) +{ + char *hooks_args = NULL; + int32_t ret = -1; + xlator_t *this = NULL; + + this = THIS; + GF_VALIDATE_OR_GOTO ("glusterd", this, out); + GF_VALIDATE_OR_GOTO (this->name, dict, out); + GF_VALIDATE_OR_GOTO (this->name, runner, out); + + ret = dict_get_str (dict, "hooks_args", &hooks_args); + if (ret) + gf_log (this->name, GF_LOG_DEBUG, + "No Hooks Arguments."); + else + gf_log (this->name, GF_LOG_DEBUG, + "Hooks Args = %s", hooks_args); + + if (hooks_args) + runner_argprintf (runner, "%s", hooks_args); + +out: + return; +} + + int glusterd_hooks_set_volume_args (dict_t *dict, runner_t *runner) { @@ -196,6 +224,8 @@ glusterd_hooks_set_volume_args (dict_t *dict, runner_t *runner) runner_argprintf (runner, "%s=%s", key, value); } + glusterd_hooks_add_custom_args (dict, runner); + ret = 0; out: return ret; @@ -263,15 +293,7 @@ glusterd_hooks_add_op_args (runner_t *runner, glusterd_op_t op, break; case GD_OP_GSYNC_CREATE: - ret = dict_get_str (op_ctx, "hooks_args", &hooks_args); - if (ret) - gf_log ("", GF_LOG_DEBUG, - "No Hooks Arguments."); - else - gf_log ("", GF_LOG_DEBUG, - "Hooks Args = %s", hooks_args); - if (hooks_args) - runner_argprintf (runner, "%s", hooks_args); + glusterd_hooks_add_custom_args (op_ctx, runner); break; case GD_OP_ADD_BRICK: |