summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 6650043c175..ab1156178b6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1730,24 +1730,20 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "volume%d.username", count);
str = glusterd_auth_get_username (volinfo);
- if (!str) {
- ret = -1;
- goto out;
+ if (str) {
+ ret = dict_set_dynstr (dict, key, gf_strdup (str));
+ if (ret)
+ goto out;
}
- ret = dict_set_dynstr (dict, key, gf_strdup (str));
- if (ret)
- goto out;
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "volume%d.password", count);
str = glusterd_auth_get_password (volinfo);
- if (!str) {
- ret = -1;
- goto out;
+ if (str) {
+ ret = dict_set_dynstr (dict, key, gf_strdup (str));
+ if (ret)
+ goto out;
}
- ret = dict_set_dynstr (dict, key, gf_strdup (str));
- if (ret)
- goto out;
memset (key, 0, sizeof (key));
snprintf (key, 256, "volume%d."GLUSTERD_STORE_KEY_RB_STATUS, count);