Commit 712ab6a3 authored by Jérome Perrin's avatar Jérome Perrin Committed by Rafael Monnerat

subscription_request: produce stable json for easier testing

sorted and with the usual workaround for trailing space bug
parent 90f756ea
...@@ -35,6 +35,11 @@ for i in range(amount): ...@@ -35,6 +35,11 @@ for i in range(amount):
xml_parameter = """<?xml version="1.0" encoding="utf-8"?> xml_parameter = """<?xml version="1.0" encoding="utf-8"?>
<instance> <instance>
<parameter id="_">%s</parameter> <parameter id="_">%s</parameter>
</instance>""" % json.dumps(json_parameter, indent=2) </instance>""" % json.dumps(json_parameter,
indent=2,
sort_keys=True,
# BBB PY2 https://github.com/python/cpython/issues/60537#issuecomment-1093598422
separators=(',', ': '),
)
return xml_parameter return xml_parameter
...@@ -122,11 +122,11 @@ class TestSubscriptionCondition_renderKVMClusterParameter(TestSubscriptionSkinsM ...@@ -122,11 +122,11 @@ class TestSubscriptionCondition_renderKVMClusterParameter(TestSubscriptionSkinsM
"KVM0": { "KVM0": {
"cpu-count": 40, "cpu-count": 40,
"cpu-max-count": 41, "cpu-max-count": 41,
"ram-size": 245760, "disable-ansible-promise": true,
"ram-max-size": 245761,
"disk-device-path": "/dev/sdb", "disk-device-path": "/dev/sdb",
"project-guid": "PROJ-XXXX", "project-guid": "PROJ-XXXX",
"disable-ansible-promise": true "ram-max-size": 245761,
"ram-size": 245760
} }
} }
}</parameter> }</parameter>
...@@ -144,13 +144,13 @@ class TestSubscriptionCondition_renderKVMClusterParameter(TestSubscriptionSkinsM ...@@ -144,13 +144,13 @@ class TestSubscriptionCondition_renderKVMClusterParameter(TestSubscriptionSkinsM
<parameter id="_">{ <parameter id="_">{
"kvm-partition-dict": { "kvm-partition-dict": {
"KVM0": { "KVM0": {
"disable-ansible-promise": true, "cpu-count": 40,
"disk-device-path": "/dev/sdb", "cpu-max-count": 41,
"cpu-count": 40, "disable-ansible-promise": true,
"ram-max-size": 245761, "disk-device-path": "/dev/sdb",
"ram-size": 245760, "project-guid": "PROJ-XXXX",
"project-guid": "PROJ-XXXX", "ram-max-size": 245761,
"cpu-max-count": 41, "ram-size": 245760,
"sticky-computer": true "sticky-computer": true
} }
} }
...@@ -163,23 +163,23 @@ class TestSubscriptionCondition_renderKVMClusterParameter(TestSubscriptionSkinsM ...@@ -163,23 +163,23 @@ class TestSubscriptionCondition_renderKVMClusterParameter(TestSubscriptionSkinsM
<parameter id="_">{ <parameter id="_">{
"kvm-partition-dict": { "kvm-partition-dict": {
"KVM0": { "KVM0": {
"disable-ansible-promise": true, "cpu-count": 40,
"disk-device-path": "/dev/sdb", "cpu-max-count": 41,
"cpu-count": 40, "disable-ansible-promise": true,
"ram-max-size": 245761, "disk-device-path": "/dev/sdb",
"ram-size": 245760, "project-guid": "PROJ-XXXX",
"project-guid": "PROJ-XXXX", "ram-max-size": 245761,
"cpu-max-count": 41, "ram-size": 245760,
"sticky-computer": true "sticky-computer": true
}, },
"KVM1": { "KVM1": {
"disk-device-path": "/dev/sdb", "cpu-count": 40,
"cpu-count": 40, "cpu-max-count": 41,
"ram-max-size": 245761, "disable-ansible-promise": true,
"cpu-max-count": 41, "disk-device-path": "/dev/sdb",
"disable-ansible-promise": true, "project-guid": "PROJ-XXXX",
"ram-size": 245760, "ram-max-size": 245761,
"project-guid": "PROJ-XXXX" "ram-size": 245760
} }
} }
}</parameter> }</parameter>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment