From 68fe44121e0545c681624993638c1eec5f636621 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Tue, 29 Apr 2014 12:28:54 +0100 Subject: [PATCH] Add specific regexp for timestamps in v2 xml datetime objects are serialized into xml using simply str() and this is a slightly different format from ISO8601 in that the date isn't separated from the time using 'T'. (However, note that the iso8601 library happily accepts this format) Add a specific regexp for this format so we can test for it in the places we know it is used. This also means we can remove the generic %(timestamp)s regexp. Note that unlike the isotime and strtime formats, whether this format includes timezone or microsecond information depends on whether the datetime object had those fields set. The isotime format always includes a timezone but not microseconds, whereas the strtime format never includes a timezone but always includes microseconds. There are a small number of examples where this format is used in JSON too - e.g. the instance usage audit log extension pre-serializes its timestamps by doing: return dict(period_beginning=str(begin), period_ending=str(end), Using a name like 'xmltime' for the timestamp format used in cases like this actually makes sense - it highlights that the format used in this case is a weird mistake. Full context here: http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html Change-Id: I70f839ac17273ed10078b833aeba308bd5e994e1 --- .../os-extended-services-delete/services-get-resp.xml | 8 ++++---- .../os-instance-actions/instance-action-get-resp.xml | 2 +- doc/api_samples/os-services/services-get-resp.xml | 8 ++++---- .../os-services/services-list-get-resp.xml | 8 ++++---- doc/api_samples/os-volumes/os-volumes-detail-resp.xml | 4 ++-- doc/api_samples/os-volumes/os-volumes-get-resp.xml | 4 ++-- doc/api_samples/os-volumes/os-volumes-index-resp.xml | 4 ++-- doc/api_samples/os-volumes/os-volumes-post-resp.xml | 4 ++-- .../api_samples/OS-SRV-USG/server-get-resp.xml.tpl | 2 +- .../OS-SRV-USG/servers-detail-resp.xml.tpl | 2 +- .../all_extensions/server-get-resp.xml.tpl | 2 +- .../all_extensions/servers-details-resp.xml.tpl | 2 +- .../os-aggregates/aggregate-post-resp.xml.tpl | 2 +- .../os-aggregates/aggregate-update-post-resp.xml.tpl | 4 ++-- .../aggregates-add-host-post-resp.xml.tpl | 2 +- .../os-aggregates/aggregates-get-resp.xml.tpl | 2 +- .../os-aggregates/aggregates-list-get-resp.xml.tpl | 2 +- .../aggregates-metadata-post-resp.xml.tpl | 2 +- .../aggregates-remove-host-post-resp.xml.tpl | 2 +- .../services-get-resp.xml.tpl | 8 ++++---- .../instance-action-get-resp.xml.tpl | 6 +++--- .../instance-actions-list-resp.xml.tpl | 4 ++-- .../inst-usage-audit-log-index-get-resp.json.tpl | 4 ++-- .../inst-usage-audit-log-index-get-resp.xml.tpl | 4 ++-- .../inst-usage-audit-log-show-get-resp.json.tpl | 4 ++-- .../inst-usage-audit-log-show-get-resp.xml.tpl | 4 ++-- .../os-keypairs/keypairs-get-resp.json.tpl | 2 +- .../api_samples/os-keypairs/keypairs-get-resp.xml.tpl | 2 +- .../api_samples/os-networks/network-show-resp.xml.tpl | 4 ++-- .../os-networks/networks-list-resp.xml.tpl | 6 +++--- .../api_samples/os-services/services-get-resp.xml.tpl | 8 ++++---- .../os-services/services-list-get-resp.xml.tpl | 8 ++++---- .../simple-tenant-usage-get-specific.xml.tpl | 6 +++--- .../simple-tenant-usage-get.xml.tpl | 4 ++-- .../os-volumes/os-volumes-detail-resp.xml.tpl | 2 +- .../os-volumes/os-volumes-get-resp.xml.tpl | 2 +- .../os-volumes/os-volumes-index-resp.xml.tpl | 2 +- .../os-volumes/os-volumes-post-resp.xml.tpl | 2 +- .../os-volumes/snapshot-create-resp.xml.tpl | 2 +- .../os-volumes/snapshots-detail-resp.xml.tpl | 6 +++--- .../os-volumes/snapshots-list-resp.xml.tpl | 6 +++--- .../os-volumes/snapshots-show-resp.xml.tpl | 2 +- nova/tests/integrated/api_samples_test_base.py | 11 ++++------- 43 files changed, 86 insertions(+), 89 deletions(-) diff --git a/doc/api_samples/os-extended-services-delete/services-get-resp.xml b/doc/api_samples/os-extended-services-delete/services-get-resp.xml index bb5b46770a..b5182a38be 100644 --- a/doc/api_samples/os-extended-services-delete/services-get-resp.xml +++ b/doc/api_samples/os-extended-services-delete/services-get-resp.xml @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/doc/api_samples/os-instance-actions/instance-action-get-resp.xml b/doc/api_samples/os-instance-actions/instance-action-get-resp.xml index 2ebc14061d..0fa985798c 100644 --- a/doc/api_samples/os-instance-actions/instance-action-get-resp.xml +++ b/doc/api_samples/os-instance-actions/instance-action-get-resp.xml @@ -1,5 +1,5 @@ - + diff --git a/doc/api_samples/os-services/services-get-resp.xml b/doc/api_samples/os-services/services-get-resp.xml index 997fc3945f..6d42fce85c 100644 --- a/doc/api_samples/os-services/services-get-resp.xml +++ b/doc/api_samples/os-services/services-get-resp.xml @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/doc/api_samples/os-services/services-list-get-resp.xml b/doc/api_samples/os-services/services-list-get-resp.xml index 68809e9aaf..e9868c2f26 100644 --- a/doc/api_samples/os-services/services-list-get-resp.xml +++ b/doc/api_samples/os-services/services-list-get-resp.xml @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/doc/api_samples/os-volumes/os-volumes-detail-resp.xml b/doc/api_samples/os-volumes/os-volumes-detail-resp.xml index b849c2d2ea..c6ff8c23e7 100644 --- a/doc/api_samples/os-volumes/os-volumes-detail-resp.xml +++ b/doc/api_samples/os-volumes/os-volumes-detail-resp.xml @@ -1,9 +1,9 @@ - + - \ No newline at end of file + diff --git a/doc/api_samples/os-volumes/os-volumes-get-resp.xml b/doc/api_samples/os-volumes/os-volumes-get-resp.xml index 1a516d5d2a..a65b78c9de 100644 --- a/doc/api_samples/os-volumes/os-volumes-get-resp.xml +++ b/doc/api_samples/os-volumes/os-volumes-get-resp.xml @@ -1,7 +1,7 @@ - + - \ No newline at end of file + diff --git a/doc/api_samples/os-volumes/os-volumes-index-resp.xml b/doc/api_samples/os-volumes/os-volumes-index-resp.xml index b849c2d2ea..c6ff8c23e7 100644 --- a/doc/api_samples/os-volumes/os-volumes-index-resp.xml +++ b/doc/api_samples/os-volumes/os-volumes-index-resp.xml @@ -1,9 +1,9 @@ - + - \ No newline at end of file + diff --git a/doc/api_samples/os-volumes/os-volumes-post-resp.xml b/doc/api_samples/os-volumes/os-volumes-post-resp.xml index 1a516d5d2a..a65b78c9de 100644 --- a/doc/api_samples/os-volumes/os-volumes-post-resp.xml +++ b/doc/api_samples/os-volumes/os-volumes-post-resp.xml @@ -1,7 +1,7 @@ - + - \ No newline at end of file + diff --git a/nova/tests/integrated/api_samples/OS-SRV-USG/server-get-resp.xml.tpl b/nova/tests/integrated/api_samples/OS-SRV-USG/server-get-resp.xml.tpl index 3950b6918b..ee35f36fa0 100644 --- a/nova/tests/integrated/api_samples/OS-SRV-USG/server-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/OS-SRV-USG/server-get-resp.xml.tpl @@ -1,5 +1,5 @@ - + diff --git a/nova/tests/integrated/api_samples/OS-SRV-USG/servers-detail-resp.xml.tpl b/nova/tests/integrated/api_samples/OS-SRV-USG/servers-detail-resp.xml.tpl index 8869b45458..bce5e2eabe 100644 --- a/nova/tests/integrated/api_samples/OS-SRV-USG/servers-detail-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/OS-SRV-USG/servers-detail-resp.xml.tpl @@ -1,6 +1,6 @@ - + diff --git a/nova/tests/integrated/api_samples/all_extensions/server-get-resp.xml.tpl b/nova/tests/integrated/api_samples/all_extensions/server-get-resp.xml.tpl index daa0bcf7ec..1bd75a99b9 100644 --- a/nova/tests/integrated/api_samples/all_extensions/server-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/all_extensions/server-get-resp.xml.tpl @@ -1,5 +1,5 @@ - + diff --git a/nova/tests/integrated/api_samples/all_extensions/servers-details-resp.xml.tpl b/nova/tests/integrated/api_samples/all_extensions/servers-details-resp.xml.tpl index f8482431c9..bf8dc083cd 100644 --- a/nova/tests/integrated/api_samples/all_extensions/servers-details-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/all_extensions/servers-details-resp.xml.tpl @@ -1,6 +1,6 @@ - + diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregate-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregate-post-resp.xml.tpl index f8603ac33f..2a1bee5868 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregate-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregate-post-resp.xml.tpl @@ -3,7 +3,7 @@ name nova False - %(timestamp)s + %(xmltime)s None None %(aggregate_id)s diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregate-update-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregate-update-post-resp.xml.tpl index 071e1c43a6..1ff22bc0e0 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregate-update-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregate-update-post-resp.xml.tpl @@ -3,8 +3,8 @@ newname nova2 False - %(timestamp)s - %(timestamp)s + %(xmltime)s + %(xmltime)s None 1 diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregates-add-host-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregates-add-host-post-resp.xml.tpl index a45a017894..7412dee66d 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregates-add-host-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregates-add-host-post-resp.xml.tpl @@ -3,7 +3,7 @@ name nova False - %(timestamp)s + %(xmltime)s None %(compute_host)s diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregates-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregates-get-resp.xml.tpl index d59d10a842..7f44a231cb 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregates-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregates-get-resp.xml.tpl @@ -3,7 +3,7 @@ name nova False - %(timestamp)s + %(xmltime)s None None diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregates-list-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregates-list-get-resp.xml.tpl index 0a6173a0ba..79af4a8d89 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregates-list-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregates-list-get-resp.xml.tpl @@ -4,7 +4,7 @@ name nova False - %(timestamp)s + %(xmltime)s None None diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregates-metadata-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregates-metadata-post-resp.xml.tpl index 5b229cfc9e..01245a4dbb 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregates-metadata-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregates-metadata-post-resp.xml.tpl @@ -3,7 +3,7 @@ name nova False - %(timestamp)s + %(xmltime)s None None diff --git a/nova/tests/integrated/api_samples/os-aggregates/aggregates-remove-host-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-aggregates/aggregates-remove-host-post-resp.xml.tpl index d59d10a842..7f44a231cb 100644 --- a/nova/tests/integrated/api_samples/os-aggregates/aggregates-remove-host-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-aggregates/aggregates-remove-host-post-resp.xml.tpl @@ -3,7 +3,7 @@ name nova False - %(timestamp)s + %(xmltime)s None None diff --git a/nova/tests/integrated/api_samples/os-extended-services-delete/services-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-extended-services-delete/services-get-resp.xml.tpl index 1b1a3cf74c..8e87af9173 100644 --- a/nova/tests/integrated/api_samples/os-extended-services-delete/services-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-extended-services-delete/services-get-resp.xml.tpl @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/nova/tests/integrated/api_samples/os-instance-actions/instance-action-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-instance-actions/instance-action-get-resp.xml.tpl index 6cd44bfc45..61c0ac8c76 100644 --- a/nova/tests/integrated/api_samples/os-instance-actions/instance-action-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-instance-actions/instance-action-get-resp.xml.tpl @@ -1,5 +1,5 @@ - - - + + + diff --git a/nova/tests/integrated/api_samples/os-instance-actions/instance-actions-list-resp.xml.tpl b/nova/tests/integrated/api_samples/os-instance-actions/instance-actions-list-resp.xml.tpl index 943b1ba747..87a8726cce 100644 --- a/nova/tests/integrated/api_samples/os-instance-actions/instance-actions-list-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-instance-actions/instance-actions-list-resp.xml.tpl @@ -1,5 +1,5 @@ - - + + diff --git a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.json.tpl index 6974f360fc..81b0d6c341 100644 --- a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.json.tpl @@ -9,8 +9,8 @@ "num_hosts_not_run": 1, "num_hosts_running": 0, "overall_status": "0 of 1 hosts done. 0 errors.", - "period_beginning": "%(timestamp)s", - "period_ending": "%(timestamp)s", + "period_beginning": "%(xmltime)s", + "period_ending": "%(xmltime)s", "total_errors": 0, "total_instances": 0 } diff --git a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.xml.tpl index 4eafa8b4aa..8b670b0c91 100644 --- a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-index-get-resp.xml.tpl @@ -10,7 +10,7 @@ %(hostid)s 0 of 1 hosts done. 0 errors. - %(timestamp)s - %(timestamp)s + %(xmltime)s + %(xmltime)s 1 diff --git a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.json.tpl index eda9523047..71549c156b 100644 --- a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.json.tpl @@ -9,8 +9,8 @@ "num_hosts_not_run": 1, "num_hosts_running": 0, "overall_status": "0 of 1 hosts done. 0 errors.", - "period_beginning": "%(timestamp)s", - "period_ending": "%(timestamp)s", + "period_beginning": "%(xmltime)s", + "period_ending": "%(xmltime)s", "total_errors": 0, "total_instances": 0 } diff --git a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.xml.tpl index 1ef243292a..9ceb1c26c8 100644 --- a/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-instance_usage_audit_log/inst-usage-audit-log-show-get-resp.xml.tpl @@ -10,7 +10,7 @@ %(hostid)s 0 of 1 hosts done. 0 errors. - %(timestamp)s - %(timestamp)s + %(xmltime)s + %(xmltime)s 1 diff --git a/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.json.tpl b/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.json.tpl index 3a188cfc81..4fde60f14b 100644 --- a/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.json.tpl +++ b/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.json.tpl @@ -5,7 +5,7 @@ "fingerprint": "%(fingerprint)s", "user_id": "fake", "deleted": false, - "created_at": "%(timestamp)s", + "created_at": "%(strtime)s", "updated_at": null, "deleted_at": null, "id": 1 diff --git a/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.xml.tpl index bdaebc47d6..3442f1ed62 100644 --- a/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-keypairs/keypairs-get-resp.xml.tpl @@ -6,7 +6,7 @@ %(fingerprint)s fake False - %(timestamp)s + %(xmltime)s None None 1 diff --git a/nova/tests/integrated/api_samples/os-networks/network-show-resp.xml.tpl b/nova/tests/integrated/api_samples/os-networks/network-show-resp.xml.tpl index 7989f47e4b..aeab222391 100644 --- a/nova/tests/integrated/api_samples/os-networks/network-show-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-networks/network-show-resp.xml.tpl @@ -4,7 +4,7 @@ 1000 %(ip)s eth0 - %(timestamp)s + %(xmltime)s %(id)s None None @@ -23,7 +23,7 @@ %(ip)s False None - %(timestamp)s + %(xmltime)s nsokolov-desktop None None diff --git a/nova/tests/integrated/api_samples/os-networks/networks-list-resp.xml.tpl b/nova/tests/integrated/api_samples/os-networks/networks-list-resp.xml.tpl index c01c083378..7ac19a8137 100644 --- a/nova/tests/integrated/api_samples/os-networks/networks-list-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-networks/networks-list-resp.xml.tpl @@ -5,7 +5,7 @@ 1000 %(ip)s eth0 - %(timestamp)s + %(xmltime)s %(id)s None None @@ -24,7 +24,7 @@ %(ip)s False None - %(timestamp)s + %(xmltime)s nsokolov-desktop None None @@ -54,7 +54,7 @@ None False None - %(timestamp)s + %(xmltime)s None None None diff --git a/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl index 53f8541ad6..ed8bb14dfc 100644 --- a/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-services/services-get-resp.xml.tpl @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/nova/tests/integrated/api_samples/os-services/services-list-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-services/services-list-get-resp.xml.tpl index e708aa78d2..1c6b0113b7 100644 --- a/nova/tests/integrated/api_samples/os-services/services-list-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-services/services-list-get-resp.xml.tpl @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get-specific.xml.tpl b/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get-specific.xml.tpl index 4a68823079..014c2f9d64 100644 --- a/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get-specific.xml.tpl +++ b/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get-specific.xml.tpl @@ -5,8 +5,8 @@ 1.0 512.0 1.0 - %(timestamp)s - %(timestamp)s + %(xmltime)s + %(xmltime)s %(uuid)s @@ -17,7 +17,7 @@ 1 openstack m1.tiny - %(timestamp)s + %(xmltime)s None active 3600 diff --git a/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get.xml.tpl b/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get.xml.tpl index 4a2833da83..b1bb63f1c4 100644 --- a/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get.xml.tpl +++ b/nova/tests/integrated/api_samples/os-simple-tenant-usage/simple-tenant-usage-get.xml.tpl @@ -6,8 +6,8 @@ 1.0 512.0 1.0 - %(timestamp)s - %(timestamp)s + %(xmltime)s + %(xmltime)s diff --git a/nova/tests/integrated/api_samples/os-volumes/os-volumes-detail-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/os-volumes-detail-resp.xml.tpl index 7410bed49e..bd8f324ee0 100644 --- a/nova/tests/integrated/api_samples/os-volumes/os-volumes-detail-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/os-volumes-detail-resp.xml.tpl @@ -1,6 +1,6 @@ - + diff --git a/nova/tests/integrated/api_samples/os-volumes/os-volumes-get-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/os-volumes-get-resp.xml.tpl index 6503138f08..cb3c5edf90 100644 --- a/nova/tests/integrated/api_samples/os-volumes/os-volumes-get-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/os-volumes-get-resp.xml.tpl @@ -1,5 +1,5 @@ - + diff --git a/nova/tests/integrated/api_samples/os-volumes/os-volumes-index-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/os-volumes-index-resp.xml.tpl index 7410bed49e..bd8f324ee0 100644 --- a/nova/tests/integrated/api_samples/os-volumes/os-volumes-index-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/os-volumes-index-resp.xml.tpl @@ -1,6 +1,6 @@ - + diff --git a/nova/tests/integrated/api_samples/os-volumes/os-volumes-post-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/os-volumes-post-resp.xml.tpl index 6503138f08..cb3c5edf90 100644 --- a/nova/tests/integrated/api_samples/os-volumes/os-volumes-post-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/os-volumes-post-resp.xml.tpl @@ -1,5 +1,5 @@ - + diff --git a/nova/tests/integrated/api_samples/os-volumes/snapshot-create-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/snapshot-create-resp.xml.tpl index d75ae7ddd8..78268c822c 100644 --- a/nova/tests/integrated/api_samples/os-volumes/snapshot-create-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/snapshot-create-resp.xml.tpl @@ -1,2 +1,2 @@ - + diff --git a/nova/tests/integrated/api_samples/os-volumes/snapshots-detail-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/snapshots-detail-resp.xml.tpl index dbfe32526a..730921f4cf 100644 --- a/nova/tests/integrated/api_samples/os-volumes/snapshots-detail-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/snapshots-detail-resp.xml.tpl @@ -1,6 +1,6 @@ - - - + + + diff --git a/nova/tests/integrated/api_samples/os-volumes/snapshots-list-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/snapshots-list-resp.xml.tpl index dbfe32526a..730921f4cf 100644 --- a/nova/tests/integrated/api_samples/os-volumes/snapshots-list-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/snapshots-list-resp.xml.tpl @@ -1,6 +1,6 @@ - - - + + + diff --git a/nova/tests/integrated/api_samples/os-volumes/snapshots-show-resp.xml.tpl b/nova/tests/integrated/api_samples/os-volumes/snapshots-show-resp.xml.tpl index 3525851cfe..c42bf41b3c 100644 --- a/nova/tests/integrated/api_samples/os-volumes/snapshots-show-resp.xml.tpl +++ b/nova/tests/integrated/api_samples/os-volumes/snapshots-show-resp.xml.tpl @@ -1,2 +1,2 @@ - + diff --git a/nova/tests/integrated/api_samples_test_base.py b/nova/tests/integrated/api_samples_test_base.py index 07d9893c1d..1089e0fbb3 100644 --- a/nova/tests/integrated/api_samples_test_base.py +++ b/nova/tests/integrated/api_samples_test_base.py @@ -268,17 +268,14 @@ class ApiSampleTestBase(integrated_helpers._IntegratedTestBase): text = r'[^<]*' isotime_re = '\d{4}-[0,1]\d-[0-3]\dT\d{2}:\d{2}:\d{2}Z' strtime_re = '\d{4}-[0,1]\d-[0-3]\dT\d{2}:\d{2}:\d{2}\.\d{6}' - # NOTE(treinish): Could result in a false positive, but it - # shouldn't be an issue for this case. - timestamp_re = ('\d{4}-[0,1]\d-[0-3]\d[ ,T]' - '\d{2}:\d{2}:\d{2}' - '(Z|(\+|-)\d{2}:\d{2}|\.\d{6}|' - '\.\d{6}(Z|(\+|-)\d{2}:\d{2})|)') + xmltime_re = ('\d{4}-[0,1]\d-[0-3]\d ' + '\d{2}:\d{2}:\d{2}' + '(\.\d{6})?(\+00:00)?') return { 'isotime': isotime_re, 'strtime': strtime_re, 'strtime_or_none': r'None|%s' % strtime_re, - 'timestamp': timestamp_re, + 'xmltime': xmltime_re, 'password': '[0-9a-zA-Z]{1,12}', 'ip': '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}', 'ip6': '([0-9a-zA-Z]{1,4}:){1,7}:?[0-9a-zA-Z]{1,4}',