diff --git a/vmware_nsx/nsxlib/mh/lsn.py b/vmware_nsx/nsxlib/mh/lsn.py index 8fb4e039e4..a5f6f3e84b 100644 --- a/vmware_nsx/nsxlib/mh/lsn.py +++ b/vmware_nsx/nsxlib/mh/lsn.py @@ -106,7 +106,7 @@ def lsn_port_create(cluster, lsn_id, port_data): return nsxlib.do_request(HTTP_POST, nsxlib._build_uri_path(LSERVICESNODEPORT_RESOURCE, parent_resource_id=lsn_id), - jsonutils.dumps(port_obj), + jsonutils.dumps(port_obj, sort_keys=True), cluster=cluster)["uuid"] diff --git a/vmware_nsx/tests/unit/nsxlib/mh/test_lsn.py b/vmware_nsx/tests/unit/nsxlib/mh/test_lsn.py index ae87aa84fb..8b16b29ef6 100644 --- a/vmware_nsx/tests/unit/nsxlib/mh/test_lsn.py +++ b/vmware_nsx/tests/unit/nsxlib/mh/test_lsn.py @@ -157,7 +157,7 @@ class LSNTestCase(base.BaseTestCase): } self.mock_request.assert_called_once_with( "POST", "/ws.v1/lservices-node/%s/lport" % lsn_id, - jsonutils.dumps(port_obj), cluster=self.cluster) + jsonutils.dumps(port_obj, sort_keys=True), cluster=self.cluster) def test_lsn_port_delete(self): lsn_id = "foo_lsn_id"