Skip to content

Potential Logic change to fix long query time #1

@PeterHiggins

Description

@PeterHiggins

Hello badgerious,

I was attempting to use your module to manage a large number of wmi objects. There is a 20 second delay if a wmi query is run with properties set to empty strings. In my use case there are some properties which are key properties of the wmi object, they do not need to be set, but must be created as they are key properties.

The validation in your module forces me to set these empty properties in the resource definition, which results in > 45 minute execution time for the puppet run (I have 92 wmi objects to create).

When I create these wmi objects with powershell if I omit the 'empty' key properties they are created anyway.

I have re-worked your module somewhat to do the following:

  1. create all the key properties whether defined in the resource def or not.
  2. only check the values of the properties defined in the resource def.
  3. only use the defined properties in the catalog alias

This has the benefit of still allowing an empty wmi_obj paramter to be defined if it is desirable to enforce an empty state, while removing the burden on the puppet user to define values for key properties that they are not interested in.

I can share the changes I have made if they are more widely considered useful, I'm not sure if the logic is generally acceptable or if it is specific to my use case.

Cheers,

Peter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions