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
This commit is contained in:
Mark McLoughlin 2014-04-29 12:28:54 +01:00
parent b52a63e3b6
commit 68fe44121e
43 changed files with 86 additions and 89 deletions

View File

@ -1,6 +1,6 @@
<services>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="2012-10-29T13:42:02.000000" id="1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="2012-10-29T13:42:05.000000" id="2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="2012-09-19T06:55:34.000000" id="3"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="2012-09-18T08:03:38.000000" id="4"/>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="2012-10-29 13:42:02" id="1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="2012-10-29 13:42:05" id="2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="2012-09-19 06:55:34" id="3"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="2012-09-18 08:03:38" id="4"/>
</services>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<instanceAction instance_uuid="b48316c5-71e8-45e4-9884-6c78055b9b13" user_id="789" start_time="2012-12-05T00:00:00.000000" request_id="req-3293a3f1-b44c-4609-b8d2-d81b105636b8" action="reboot" message="" project_id="147">
<instanceAction instance_uuid="b48316c5-71e8-45e4-9884-6c78055b9b13" user_id="789" start_time="2012-12-05 00:00:00.000000" request_id="req-3293a3f1-b44c-4609-b8d2-d81b105636b8" action="reboot" message="" project_id="147">
<events finish_time="2012-12-05 01:02:00.000000" start_time="2012-12-05 01:00:02.000000" traceback="" event="schedule" result="Success"/>
<events finish_time="2012-12-05 01:04:00.000000" start_time="2012-12-05 01:03:00.000000" traceback="" event="compute_create" result="Success"/>
</instanceAction>

View File

@ -1,6 +1,6 @@
<services>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="2012-10-29T13:42:02.000000" disabled_reason="test1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="2012-10-29T13:42:05.000000" disabled_reason="test2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="2012-09-19T06:55:34.000000" disabled_reason=""/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="2012-09-18T08:03:38.000000" disabled_reason="test4"/>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="2012-10-29 13:42:02" disabled_reason="test1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="2012-10-29 13:42:05" disabled_reason="test2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="2012-09-19 06:55:34" disabled_reason=""/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="2012-09-18 08:03:38" disabled_reason="test4"/>
</services>

View File

@ -1,6 +1,6 @@
<services>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="2012-10-29T13:42:02.000000"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="2012-10-29T13:42:05.000000" />
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="2012-09-19T06:55:34.000000"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="2012-09-18T08:03:38.000000"/>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="2012-10-29 13:42:02"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="2012-10-29 13:42:05" />
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="2012-09-19 06:55:34"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="2012-09-18 08:03:38"/>
</services>

View File

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<volumes>
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01T11:01:55" size="100">
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01 11:01:55" size="100">
<attachments>
<attachment device="/" serverId="3912f2b4-c5ba-4aec-9165-872876fe202e" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" volumeId="a26887c6-c47b-4654-abb5-dfadf7d3f803"/>
</attachments>
<metadata/>
</volume>
</volumes>
</volumes>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01T11:01:55" size="100">
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01 11:01:55" size="100">
<attachments>
<attachment device="/" serverId="3912f2b4-c5ba-4aec-9165-872876fe202e" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" volumeId="a26887c6-c47b-4654-abb5-dfadf7d3f803"/>
</attachments>
<metadata/>
</volume>
</volume>

View File

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<volumes>
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01T11:01:55" size="100">
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01 11:01:55" size="100">
<attachments>
<attachment device="/" serverId="3912f2b4-c5ba-4aec-9165-872876fe202e" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" volumeId="a26887c6-c47b-4654-abb5-dfadf7d3f803"/>
</attachments>
<metadata/>
</volume>
</volumes>
</volumes>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01T11:01:55" size="100">
<volume status="in-use" displayDescription="Volume Description" availabilityZone="zone1:host1" displayName="Volume Name" volumeType="Backup" snapshotId="None" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" createdAt="2008-12-01 11:01:55" size="100">
<attachments>
<attachment device="/" serverId="3912f2b4-c5ba-4aec-9165-872876fe202e" id="a26887c6-c47b-4654-abb5-dfadf7d3f803" volumeId="a26887c6-c47b-4654-abb5-dfadf7d3f803"/>
</attachments>
<metadata/>
</volume>
</volume>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-SRV-USG:terminated_at="None" OS-SRV-USG:launched_at="%(timestamp)s">
<server xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-SRV-USG:terminated_at="None" OS-SRV-USG:launched_at="%(xmltime)s">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-SRV-USG:launched_at="%(timestamp)s" OS-SRV-USG:terminated_at="None" >
<server xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" OS-SRV-USG:launched_at="%(xmltime)s" OS-SRV-USG:terminated_at="None" >
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v1.1" xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="%(compute_host)s" OS-EXT-SRV-ATTR:hypervisor_hostname="%(hypervisor_hostname)s" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO" OS-SRV-USG:launched_at="%(timestamp)s" OS-SRV-USG:terminated_at="None">
<server xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v1.1" xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="%(compute_host)s" OS-EXT-SRV-ATTR:hypervisor_hostname="%(hypervisor_hostname)s" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO" OS-SRV-USG:launched_at="%(xmltime)s" OS-SRV-USG:terminated_at="None">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v1.1" xmlns:OS-SRV-USG="http://docs.openstack.org/compute/ext/server_usage/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="%(compute_host)s" OS-EXT-SRV-ATTR:hypervisor_hostname="%(hypervisor_hostname)s" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO" OS-SRV-USG:launched_at="%(timestamp)s" OS-SRV-USG:terminated_at="None">
<server xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:os-extended-volumes="http://docs.openstack.org/compute/ext/extended_volumes/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="%(isotime)s" hostId="%(hostid)s" name="new-server-test" created="%(isotime)s" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="%(id)s" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="%(compute_host)s" OS-EXT-SRV-ATTR:hypervisor_hostname="%(hypervisor_hostname)s" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO" OS-SRV-USG:launched_at="%(xmltime)s" OS-SRV-USG:terminated_at="None">
<image id="%(uuid)s">
<atom:link href="%(host)s/openstack/images/%(uuid)s" rel="bookmark"/>
</image>

View File

@ -3,7 +3,7 @@
<name>name</name>
<availability_zone>nova</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<deleted_at>None</deleted_at>
<id>%(aggregate_id)s</id>

View File

@ -3,8 +3,8 @@
<name>newname</name>
<availability_zone>nova2</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<updated_at>%(timestamp)s</updated_at>
<created_at>%(xmltime)s</created_at>
<updated_at>%(xmltime)s</updated_at>
<hosts/>
<deleted_at>None</deleted_at>
<id>1</id>

View File

@ -3,7 +3,7 @@
<name>name</name>
<availability_zone>nova</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<hosts>
<host>%(compute_host)s</host>

View File

@ -3,7 +3,7 @@
<name>name</name>
<availability_zone>nova</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<hosts/>
<deleted_at>None</deleted_at>

View File

@ -4,7 +4,7 @@
<name>name</name>
<availability_zone>nova</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<hosts/>
<deleted_at>None</deleted_at>

View File

@ -3,7 +3,7 @@
<name>name</name>
<availability_zone>nova</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<hosts/>
<deleted_at>None</deleted_at>

View File

@ -3,7 +3,7 @@
<name>name</name>
<availability_zone>nova</availability_zone>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<hosts/>
<deleted_at>None</deleted_at>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<services>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" updated_at="%(timestamp)s" host="host1" id="1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" updated_at="%(timestamp)s" host="host1" id="2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" updated_at="%(timestamp)s" host="host2" id="3"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" updated_at="%(timestamp)s" host="host2" id="4"/>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" updated_at="%(xmltime)s" host="host1" id="1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" updated_at="%(xmltime)s" host="host1" id="2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" updated_at="%(xmltime)s" host="host2" id="3"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" updated_at="%(xmltime)s" host="host2" id="4"/>
</services>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<instanceAction action="%(action)s" instance_uuid="%(instance_uuid)s" request_id="%(request_id)s" user_id="%(integer_id)s" project_id="%(integer_id)s" start_time="%(timestamp)s" message="">
<events event="%(event)s" start_time="%(timestamp)s" finish_time="%(timestamp)s" result="%(result)s" traceback=""/>
<events event="%(event)s" start_time="%(timestamp)s" finish_time="%(timestamp)s" result="%(result)s" traceback=""/>
<instanceAction action="%(action)s" instance_uuid="%(instance_uuid)s" request_id="%(request_id)s" user_id="%(integer_id)s" project_id="%(integer_id)s" start_time="%(xmltime)s" message="">
<events event="%(event)s" start_time="%(xmltime)s" finish_time="%(xmltime)s" result="%(result)s" traceback=""/>
<events event="%(event)s" start_time="%(xmltime)s" finish_time="%(xmltime)s" result="%(result)s" traceback=""/>
</instanceAction>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<instanceActions>
<instanceAction action="%(action)s" instance_uuid="%(uuid)s" request_id="%(request_id)s" user_id="%(integer_id)s" project_id="%(integer_id)s" start_time="%(timestamp)s" message=""/>
<instanceAction action="%(action)s" instance_uuid="%(uuid)s" request_id="%(request_id)s" user_id="%(integer_id)s" project_id="%(integer_id)s" start_time="%(timestamp)s" message=""/>
<instanceAction action="%(action)s" instance_uuid="%(uuid)s" request_id="%(request_id)s" user_id="%(integer_id)s" project_id="%(integer_id)s" start_time="%(xmltime)s" message=""/>
<instanceAction action="%(action)s" instance_uuid="%(uuid)s" request_id="%(request_id)s" user_id="%(integer_id)s" project_id="%(integer_id)s" start_time="%(xmltime)s" message=""/>
</instanceActions>

View File

@ -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
}

View File

@ -10,7 +10,7 @@
<item>%(hostid)s</item>
</hosts_not_run>
<overall_status>0 of 1 hosts done. 0 errors.</overall_status>
<period_ending>%(timestamp)s</period_ending>
<period_beginning>%(timestamp)s</period_beginning>
<period_ending>%(xmltime)s</period_ending>
<period_beginning>%(xmltime)s</period_beginning>
<num_hosts>1</num_hosts>
</instance_usage_audit_logs>

View File

@ -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
}

View File

@ -10,7 +10,7 @@
<item>%(hostid)s</item>
</hosts_not_run>
<overall_status>0 of 1 hosts done. 0 errors.</overall_status>
<period_ending>%(timestamp)s</period_ending>
<period_beginning>%(timestamp)s</period_beginning>
<period_ending>%(xmltime)s</period_ending>
<period_beginning>%(xmltime)s</period_beginning>
<num_hosts>1</num_hosts>
</instance_usage_audit_log>

View File

@ -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

View File

@ -6,7 +6,7 @@
<fingerprint>%(fingerprint)s</fingerprint>
<user_id>fake</user_id>
<deleted>False</deleted>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<updated_at>None</updated_at>
<deleted_at>None</deleted_at>
<id>1</id>

View File

@ -4,7 +4,7 @@
<vpn_public_port>1000</vpn_public_port>
<dhcp_start>%(ip)s</dhcp_start>
<bridge_interface>eth0</bridge_interface>
<updated_at>%(timestamp)s</updated_at>
<updated_at>%(xmltime)s</updated_at>
<id>%(id)s</id>
<cidr_v6>None</cidr_v6>
<deleted_at>None</deleted_at>
@ -23,7 +23,7 @@
<vpn_public_address>%(ip)s</vpn_public_address>
<multi_host>False</multi_host>
<dns2>None</dns2>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<host>nsokolov-desktop</host>
<gateway_v6>None</gateway_v6>
<netmask_v6>None</netmask_v6>

View File

@ -5,7 +5,7 @@
<vpn_public_port>1000</vpn_public_port>
<dhcp_start>%(ip)s</dhcp_start>
<bridge_interface>eth0</bridge_interface>
<updated_at>%(timestamp)s</updated_at>
<updated_at>%(xmltime)s</updated_at>
<id>%(id)s</id>
<cidr_v6>None</cidr_v6>
<deleted_at>None</deleted_at>
@ -24,7 +24,7 @@
<vpn_public_address>%(ip)s</vpn_public_address>
<multi_host>False</multi_host>
<dns2>None</dns2>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<host>nsokolov-desktop</host>
<gateway_v6>None</gateway_v6>
<netmask_v6>None</netmask_v6>
@ -54,7 +54,7 @@
<vpn_public_address>None</vpn_public_address>
<multi_host>False</multi_host>
<dns2>None</dns2>
<created_at>%(timestamp)s</created_at>
<created_at>%(xmltime)s</created_at>
<host>None</host>
<gateway_v6>None</gateway_v6>
<netmask_v6>None</netmask_v6>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<services>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" updated_at="%(timestamp)s" host="host1" disabled_reason="test1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" updated_at="%(timestamp)s" host="host1" disabled_reason="test2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" updated_at="%(timestamp)s" host="host2" disabled_reason=""/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" updated_at="%(timestamp)s" host="host2" disabled_reason="test4"/>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" updated_at="%(xmltime)s" host="host1" disabled_reason="test1"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" updated_at="%(xmltime)s" host="host1" disabled_reason="test2"/>
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" updated_at="%(xmltime)s" host="host2" disabled_reason=""/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" updated_at="%(xmltime)s" host="host2" disabled_reason="test4"/>
</services>

View File

@ -1,6 +1,6 @@
<services>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="%(timestamp)s"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="%(timestamp)s" />
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="%(timestamp)s"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="%(timestamp)s"/>
<service status="disabled" binary="nova-scheduler" zone="internal" state="up" host="host1" updated_at="%(xmltime)s"/>
<service status="disabled" binary="nova-compute" zone="nova" state="up" host="host1" updated_at="%(xmltime)s" />
<service status="enabled" binary="nova-scheduler" zone="internal" state="down" host="host2" updated_at="%(xmltime)s"/>
<service status="disabled" binary="nova-compute" zone="nova" state="down" host="host2" updated_at="%(xmltime)s"/>
</services>

View File

@ -5,8 +5,8 @@
<total_vcpus_usage>1.0</total_vcpus_usage>
<total_memory_mb_usage>512.0</total_memory_mb_usage>
<total_hours>1.0</total_hours>
<start>%(timestamp)s</start>
<stop>%(timestamp)s</stop>
<start>%(xmltime)s</start>
<stop>%(xmltime)s</stop>
<server_usages>
<server_usage>
<instance_id>%(uuid)s</instance_id>
@ -17,7 +17,7 @@
<vcpus>1</vcpus>
<tenant_id>openstack</tenant_id>
<flavor>m1.tiny</flavor>
<started_at>%(timestamp)s</started_at>
<started_at>%(xmltime)s</started_at>
<ended_at>None</ended_at>
<state>active</state>
<uptime>3600</uptime>

View File

@ -6,8 +6,8 @@
<total_vcpus_usage>1.0</total_vcpus_usage>
<total_memory_mb_usage>512.0</total_memory_mb_usage>
<total_hours>1.0</total_hours>
<start>%(timestamp)s</start>
<stop>%(timestamp)s</stop>
<start>%(xmltime)s</start>
<stop>%(xmltime)s</stop>
<server_usages/>
</tenant_usage>
</tenant_usages>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<volumes>
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(timestamp)s" size="100">
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(xmltime)s" size="100">
<attachments>
<attachment device="/" serverId="%(uuid)s" id="%(uuid)s" volumeId="%(uuid)s"/>
</attachments>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(timestamp)s" size="100">
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(xmltime)s" size="100">
<attachments>
<attachment device="/" serverId="%(uuid)s" id="%(uuid)s" volumeId="%(uuid)s"/>
</attachments>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<volumes>
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(timestamp)s" size="100">
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(xmltime)s" size="100">
<attachments>
<attachment device="/" serverId="%(uuid)s" id="%(uuid)s" volumeId="%(uuid)s"/>
</attachments>

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(timestamp)s" size="100">
<volume status="in-use" displayDescription="%(volume_desc)s" availabilityZone="zone1:host1" displayName="%(volume_name)s" volumeType="Backup" snapshotId="None" id="%(uuid)s" createdAt="%(xmltime)s" size="100">
<attachments>
<attachment device="/" serverId="%(uuid)s" id="%(uuid)s" volumeId="%(uuid)s"/>
</attachments>

View File

@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<snapshot status="available" displayDescription="%(description)s" displayName="%(snapshot_name)s" volumeId="521752a6-acf6-4b2d-bc7a-119f9148cd8c" id="100" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(description)s" displayName="%(snapshot_name)s" volumeId="521752a6-acf6-4b2d-bc7a-119f9148cd8c" id="100" createdAt="%(xmltime)s" size="100"/>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<snapshots>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="100" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="101" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="102" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="100" createdAt="%(xmltime)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="101" createdAt="%(xmltime)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="102" createdAt="%(xmltime)s" size="100"/>
</snapshots>

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<snapshots>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="100" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="101" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="102" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="100" createdAt="%(xmltime)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="101" createdAt="%(xmltime)s" size="100"/>
<snapshot status="available" displayDescription="%(text)s" displayName="%(text)s" volumeId="12" id="102" createdAt="%(xmltime)s" size="100"/>
</snapshots>

View File

@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<snapshot status="available" displayDescription="%(description)s" displayName="%(snapshot_name)s" volumeId="12" id="100" createdAt="%(timestamp)s" size="100"/>
<snapshot status="available" displayDescription="%(description)s" displayName="%(snapshot_name)s" volumeId="12" id="100" createdAt="%(xmltime)s" size="100"/>

View File

@ -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}',