Browse Source

Fix time usage in unit tests for agent power interface

The agent power interface unit tests were asking for the now() time
which is system user time relative. For example, for US-Pacific would
display 10 AM. Where as the rest of ironic was expecting 5 PM for the
test as the base code uses utcnow() instead of now().

Change-Id: Icb6bb30d1859eb3787bb5f4df4ad97143a098017
changes/35/745935/1
Julia Kreger 1 year ago
parent
commit
0d94ef67cb
  1. 2
      ironic/tests/unit/drivers/modules/test_agent_power.py

2
ironic/tests/unit/drivers/modules/test_agent_power.py

@ -30,7 +30,7 @@ class AgentPowerTest(db_base.DbTestCase):
self.config(fast_track=True, group='deploy')
self.power = agent_power.AgentPower()
dii = {
'agent_last_heartbeat': datetime.datetime.now().strftime(
'agent_last_heartbeat': datetime.datetime.utcnow().strftime(
"%Y-%m-%dT%H:%M:%S.%f"),
'deployment_reboot': True,
'agent_url': 'http://url',

Loading…
Cancel
Save