Commit b7a1b799 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Increase Bang timestamp precision to microsecond

See merge request !573
parents 61933ddd 1dec7503
......@@ -2,7 +2,7 @@ from DateTime import DateTime
instance = state_change['object']
assert instance.getPortalType() in ["Slave Instance", "Software Instance"]
instance.edit(bang_timestamp=int(DateTime()))
instance.edit(bang_timestamp=int(float(DateTime()) * 1e6))
key = "%s_bangstamp" % instance.getReference()
instance.setLastData(key, str(int(instance.getModificationDate())))
......
......@@ -594,7 +594,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
partition_1_param=self.compute_node.partition1.getAggregateRelatedValue(portal_type='Software Instance').getInstanceXmlAsDict()['paramé'],
partition_1_sla=self.compute_node.partition1.getAggregateRelatedValue(portal_type='Software Instance').getSlaXmlAsDict()['paramé'],
partition_1_software_release_url=self.compute_node.partition1.getAggregateRelatedValue(portal_type='Software Instance').getUrlString(),
partition_1_timestamp=int(self.compute_node.partition1.getAggregateRelatedValue(portal_type='Software Instance').getModificationDate()),
partition_1_timestamp=int(float(self.compute_node.partition1.getAggregateRelatedValue(portal_type='Software Instance').getModificationDate())*1e6),
partition_2_instance_guid=self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getReference(),
partition_2_instance_title=self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getTitle(),
partition_2_root_instance_title=partition_2_root_instance_title,
......@@ -602,7 +602,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
partition_2_param=self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getInstanceXmlAsDict()['paramé'],
partition_2_sla=self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getSlaXmlAsDict()['paramé'],
partition_2_software_release_url=self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getUrlString(),
partition_2_timestamp=int(self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getModificationDate()),
partition_2_timestamp=int(float(self.compute_node.partition2.getAggregateRelatedValue(portal_type='Software Instance').getModificationDate())*1e6),
partition_3_instance_guid=self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getReference(),
partition_3_instance_title=self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getTitle(),
partition_3_root_instance_title=partition_3_root_instance_title,
......@@ -610,7 +610,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
partition_3_param=self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getInstanceXmlAsDict()['paramé'],
partition_3_sla=self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getSlaXmlAsDict()['paramé'],
partition_3_software_release_url=self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getUrlString(),
partition_3_timestamp=int(self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getModificationDate()),
partition_3_timestamp=int(float(self.compute_node.partition3.getAggregateRelatedValue(portal_type='Software Instance').getModificationDate())*1e6),
slave_1_param=self.start_requested_slave_instance.getInstanceXmlAsDict()['paramé'],
slave_1_software_type=self.start_requested_slave_instance.getSourceReference(),
slave_1_instance_guid=self.start_requested_slave_instance.getReference(),
......@@ -1281,7 +1281,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
software_type=self.start_requested_software_instance.getSourceReference(),
param=self.start_requested_software_instance.getInstanceXmlAsDict()['paramé'],
sla=self.start_requested_software_instance.getSlaXmlAsDict()['paramé'],
timestamp=int(self.start_requested_software_instance.getModificationDate()),
timestamp=int(float(self.start_requested_software_instance.getModificationDate())*1e6),
slave_1_param=self.start_requested_slave_instance.getInstanceXmlAsDict()['paramé'],
slave_1_software_type=self.start_requested_slave_instance.getSourceReference(),
slave_1_instance_guid=self.start_requested_slave_instance.getReference(),
......@@ -1512,7 +1512,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
param=self.start_requested_software_instance.getInstanceXmlAsDict()['paramé'],
sla=self.start_requested_software_instance.getSlaXmlAsDict()['paramé'],
software_release_url=self.start_requested_software_instance.getUrlString(),
timestamp=int(self.start_requested_software_instance.getModificationDate()),
timestamp=int(float(self.start_requested_software_instance.getModificationDate())*1e6),
instance_guid=self.start_requested_software_instance.getReference(),
instance_title=self.start_requested_software_instance.getTitle(),
root_instance_title=self.start_requested_software_instance.getSpecialiseValue().getTitle(),
......@@ -1628,7 +1628,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
param=self.start_requested_software_instance.getInstanceXmlAsDict()['paramé'],
sla=self.start_requested_software_instance.getSlaXmlAsDict()['paramé'],
software_release_url=self.start_requested_software_instance.getUrlString(),
timestamp=int(self.start_requested_software_instance.getModificationDate()),
timestamp=int(float(self.start_requested_software_instance.getModificationDate())*1e6),
instance_guid=self.start_requested_software_instance.getReference(),
instance_title=self.start_requested_software_instance.getTitle(),
root_instance_title=self.start_requested_software_instance.getSpecialiseValue().getTitle(),
......@@ -2823,7 +2823,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
param=self.start_requested_software_instance.getInstanceXmlAsDict()['paramé'],
sla=self.start_requested_software_instance.getSlaXmlAsDict()['paramé'],
software_release_url=self.start_requested_software_instance.getUrlString(),
timestamp=int(self.start_requested_software_instance.getModificationDate()),
timestamp=int(float(self.start_requested_software_instance.getModificationDate())*1e6),
instance_guid=self.start_requested_software_instance.getReference(),
instance_title=self.start_requested_software_instance.getTitle(),
root_instance_title=self.start_requested_software_instance.getSpecialiseValue().getTitle(),
......@@ -2939,7 +2939,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
param=self.start_requested_software_instance.getInstanceXmlAsDict()['paramé'],
sla=self.start_requested_software_instance.getSlaXmlAsDict()['paramé'],
software_release_url=self.start_requested_software_instance.getUrlString(),
timestamp=int(self.start_requested_software_instance.getModificationDate()),
timestamp=int(float(self.start_requested_software_instance.getModificationDate())*1e6),
instance_guid=self.start_requested_software_instance.getReference(),
instance_title=self.start_requested_software_instance.getTitle(),
root_instance_title=self.start_requested_software_instance.getSpecialiseValue().getTitle(),
......@@ -3184,7 +3184,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
state="started",
url_string=self.start_requested_software_instance.getUrlString(),
type=self.start_requested_software_instance.getSourceReference(),
timestamp=int(self.start_requested_software_instance.getModificationDate()),
timestamp=int(float(self.start_requested_software_instance.getModificationDate())*1e6),
compute_node_id=self.compute_node_id,
partition_id=self.start_requested_software_instance.getAggregateId(),
ip=self.start_requested_software_instance.getAggregateValue()\
......
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