Skip to content

Conversation

tmmorin
Copy link
Contributor

@tmmorin tmmorin commented Aug 13, 2025

(This is meant to resolve #3492)

For the Networking v2 API, Gophercloud has support for two time formats for the created_at/updated_at fields, for most of the resources for which it supports such fields. This was introduced by #1671. Such support however is lacking for some resources (the resources for which the support for the created_at/updated_at fields was added later, in 99b0a51)

This PR adds support for two time formats for the subnet, router, and SG rule resources.

It does it in the same way as in #1671, and adds the corresponding unit tests.

@github-actions github-actions bot added edit:networking This PR updates networking code semver:minor Backwards-compatible change backport-v2 This PR will be backported to v2 labels Aug 13, 2025
@coveralls
Copy link

coveralls commented Aug 13, 2025

Coverage Status

coverage: 63.81% (+0.08%) from 63.73%
when pulling e852df2 on tmmorin:fix-3492
into a448b65 on gophercloud:main.

Copy link
Contributor

@mandre mandre left a comment

Choose a reason for hiding this comment

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

Yes! Thanks for the patch, this is exactly how we should handle different possible formats returned by OpenStack. Just a minor nit about leftover debug in each of the added UnmarshalJSON() functions.

The linter is also failing due to improperly formatted code. This needs fixing before we can merge.

return nil
}

// return errors.New("test error")
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

err... yes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(should be all clean now)

@mandre mandre merged commit 0ddc4e9 into gophercloud:main Aug 13, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v2 This PR will be backported to v2 edit:networking This PR updates networking code semver:minor Backwards-compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gophercloud >= 2.7 breaks on parsing security group time (with some Neutron configuration)
3 participants