diff options
Diffstat (limited to 'src/wsman.c')
-rw-r--r-- | src/wsman.c | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/src/wsman.c b/src/wsman.c index 69c4e5a..7361f9f 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -103,7 +103,6 @@ int main(int argc, char **argv) WsXmlDocH rqstDoc; actionOptions *options; WsXmlDocH enum_response; - WsXmlDocH reference_response; WsXmlDocH resource; char *enumeration_mode, *binding_enumeration_mode, *resource_uri_with_selectors; @@ -293,7 +292,7 @@ int main(int argc, char **argv) if (strcmp(enumeration_mode, "epr") == 0) wsman_set_action_option(options, FLAG_ENUMERATION_ENUM_EPR); - else + else if (strcmp(enumeration_mode, "objepr") == 0) wsman_set_action_option(options, FLAG_ENUMERATION_ENUM_OBJ_AND_EPR); } @@ -312,6 +311,10 @@ int main(int argc, char **argv) wsman_set_action_option(options, FLAG_POLYMORPHISM_NONE); } + if (wsman_options_get_cim_ref()) { + wsman_set_action_option(options, + FLAG_CIM_REFERENCES); + } if (wsman_options_get_optimize_enum()) { wsman_set_action_option(options, FLAG_ENUMERATION_OPTIMIZATION); @@ -322,8 +325,7 @@ int main(int argc, char **argv) wsman_set_action_option(options, FLAG_ENUMERATION_COUNT_ESTIMATION); } - enum_response = wsenum_enumerate(cl, - resource_uri, options); + enum_response = wsenum_enumerate(cl, resource_uri, options); wsman_output(cl, enum_response); if (enum_response) { if (!(wsman_client_get_response_code(cl) == 200 || @@ -358,40 +360,6 @@ int main(int argc, char **argv) } u_free(enumContext); break; - case WSMAN_ACTION_ENUMERATE_REFERENCE_INSTANCES: - fprintf(stderr, "Enumerate Reference Instances. resource_uri: %s\n", resource_uri); - reference_response = wsenum_reference_instances(cl, resource_uri, options); - wsman_output(cl, reference_response); - if (reference_response) { - if (!(wsman_client_get_response_code(cl) == 200 || - wsman_client_get_response_code(cl) == 400 || - wsman_client_get_response_code(cl) == 500)) { - break; - } - enumContext = wsenum_get_enum_context(reference_response); - ws_xml_destroy_doc(reference_response); - } else { - break; - } - - if (!wsman_options_get_step_request()) { - while (enumContext != NULL && enumContext[0] != 0) { - - doc = wsenum_pull(cl, resource_uri, options, enumContext); - wsman_output(cl, doc); - - if (wsman_client_get_response_code(cl) != 200 && - wsman_client_get_response_code(cl) != 400 && - wsman_client_get_response_code(cl) != 500) { - break; - } - enumContext = wsenum_get_enum_context(doc); - if (doc) { - ws_xml_destroy_doc(doc); - } - } - } - break; default: fprintf(stderr, "Action not supported\n"); retVal = 1; |