Skip to content

[Platform API] HTTP server provides default JSON serialization for unserializable objects#1756

Merged
jleveque merged 2 commits intosonic-net:masterfrom
jleveque:plat_api_server_default_obj_serialization
Jun 21, 2020
Merged

[Platform API] HTTP server provides default JSON serialization for unserializable objects#1756
jleveque merged 2 commits intosonic-net:masterfrom
jleveque:plat_api_server_default_obj_serialization

Conversation

@jleveque
Copy link
Contributor

@jleveque jleveque commented Jun 11, 2020

Previously, if the server encountered an unserializable object, it would throw an exception similar to the following and return None:

TypeError: <sonic_platform.fan.Fan object at 0x7fe6f4d12790> is not JSON serializable

With this change, if the server encounters an unserializable object, it will log a warning to the syslog on the DuT and return a JSON object with the following contents to allow the calling test to work properly:

{
    '__class__': <class name>,
    '__module__': <module name>
}

@jleveque jleveque self-assigned this Jun 11, 2020
@lguohan lguohan requested a review from sujinmkang June 15, 2020 22:15
@jleveque jleveque merged commit ae70e79 into sonic-net:master Jun 21, 2020
@jleveque jleveque deleted the plat_api_server_default_obj_serialization branch June 21, 2020 20:24
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
sonic-utilities:
* 8b98d45 2021-05-25 | [show] support for show muxcable firmware version of only active banks (sonic-net#1629) (HEAD -> 202012) [vdahiya12]
* afd0975 2021-05-20 | [show] add support for muxcable metrics (sonic-net#1615) [vdahiya12]

sonic-swss
* 7611df5 2021-05-27 | [tunneldecaporch] Set default MTU for the overlay loopback interface (sonic-net#1756) (HEAD -> 202012) [Volodymyr Samotiy]
* 22fbb5c 2021-05-27 | [202012] Resolve neighbor when nexthop does not exist (sonic-net#1759) (github/202012) [Shi Su]
* ec7710c 2021-05-27 | [Bulk mode] Limit the size of bulker (sonic-net#1760) [Shi Su]

Signed-off-by: Ying Xie <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…nic-net#8627)

7041400 [config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services (sonic-net#1773) (sonic-net#1786)
399d370 Fix logic in RIF counters print (sonic-net#1732)
8329544 [vnet_route_check] don't hardcode prefix length of /24 (sonic-net#1756)
193b028 [neighbor-advertiser] delete the tunnel maps appropriately (sonic-net#1663)
2c82bcf [neighbor_advertiser] Use existing tunnel if present for creating tunnel mappings (sonic-net#1589)
8e22960 [202012][Config] Update config command of Kdump. (sonic-net#1778)
be3e5c6 [show][config] cli refactor for muxcable with abstract class implementation from vendors (sonic-net#1722) (sonic-net#1782)
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
09457e524797bd988e011e24250a5e5c942bfdf2 (HEAD -> 201911, origin/201911)[tunneldecaporch] Set default MTU for the overlay loopback interface (sonic-net#1756)

Signed-off-by: Abhishek Dosi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants