Use API instead of internal data structure to set properties
diff --git a/src/wsman.c b/src/wsman.c index 0ab6a17..a780016 100644 --- a/src/wsman.c +++ b/src/wsman.c
@@ -478,25 +478,18 @@ -static hash_t *wsman_options_get_properties(void) +static void +wsman_options_set_properties(client_opt_t *options) { int c = 0; - hash_t *h = hash_create(HASHCOUNT_T_MAX, 0, 0); while (properties != NULL && properties[c] != NULL) { char *cc[3]; u_tokenize1(cc, 2, properties[c], '='); - if (!hash_lookup(h, cc[0])) { - if (!hash_alloc_insert(h, cc[0], cc[1])) { - debug("hash_alloc_insert failed"); - } - } else { - warn("duplicate not added to hash"); - } - + wsmc_add_property(options, cc[0], cc[1]); c++; } - return h; + return; } @@ -659,7 +652,7 @@ options->fragment = fragment; } - options->properties = wsman_options_get_properties(); + wsman_options_set_properties(options); options->cim_ns = cim_namespace; if (cim_extensions) { wsmc_set_action_option(options, FLAG_CIM_EXTENSIONS);
diff --git a/tests/interop/interop.c b/tests/interop/interop.c index c537091..5137784 100644 --- a/tests/interop/interop.c +++ b/tests/interop/interop.c
@@ -30,12 +30,7 @@ static void set_props(client_opt_t *op, char *k, char *v) { - op->properties = hash_create(HASHCOUNT_T_MAX, 0, 0); - - if ( !hash_alloc_insert(op->properties, k, v)) { - fprintf(stderr, "hash_alloc_insert failed"); - } - //op->properties = h; + wsmc_add_property(op, k, v); } static void