Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the input and the output of date and time related attributes are the same #19

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

ronger4
Copy link
Contributor

@ronger4 ronger4 commented Jan 23, 2025

SUMMARY

Before the change info module would return date time strings as dictionary the following:

"resetInterval": {
              "Days": 0,
              "Hours": 0,
              "Milliseconds": 0,
              "Minutes": 5,
              "Seconds": 0,
              "Ticks": 3000000000,
              "TotalDays": 0.003472222222222222,
              "TotalHours": 0.08333333333333333,
              "TotalMilliseconds": 300000,
              "TotalMinutes": 5,
              "TotalSeconds": 300
            },

This type differs from input hence, it was changed to be returned a string representation of datetime.
"resetInterval": "00:05:00",

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

web_app_pool
web_app_pool_info

ADDITIONAL INFORMATION

Fixes #14


Copy link

plugins/modules/web_app_pool_info.ps1 Outdated Show resolved Hide resolved
@@ -75,6 +78,10 @@ function Get-AppPoolInfo ($name) {
foreach ($attribute in $pool.recycling.periodicRestart.Attributes) {
$attribute_name = $attribute.Name
$attribute_value = $pool.recycling.periodicRestart.$attribute_name
# Convert TimeSpan to string if applicable
if ($attribute_value -is [TimeSpan]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there this second check, shouldn't the above be setting it properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It handles the priodicRestart section.
As priodicRestart sectioned handled separately (as it's the only 3rd layer attribute in the dict).
This is an original code which I didn't change.
This attribute needs to be date handled too and not handled in the loop above.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense. I think it would have been preferable to just recursively go through the dict at the end and check all types but if this works then that may be overkill.

Copy link

@jborean93 jborean93 merged commit 14f1fd8 into ansible-collections:main Jan 27, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify format of web_app_pool_info output types
2 participants