Remove dependence on heat.common

Change-Id: I6b13b184edbc51a48633c82ce2db9814c9f7e2ce
This commit is contained in:
rabi 2017-11-17 22:57:58 +05:30
parent 94a520a653
commit 3220134fbe
2 changed files with 9 additions and 3 deletions

View File

@ -60,6 +60,12 @@ def call_until_true(duration, sleep_for, func, *args, **kwargs):
return False
def isotime(at):
if at is None:
return None
return at.strftime('%Y-%m-%dT%H:%M:%SZ')
def rand_name(name=''):
randbits = six.text_type(random.randint(1, 0x7fffffff))
if name:

View File

@ -11,7 +11,6 @@
# under the License.
import datetime
from heat.common import timeutils
from oslo_log import log as logging
from heat_tempest_plugin.common import test
@ -48,8 +47,9 @@ class AodhAlarmTest(scenario_base.ScenarioTestsBase):
parameters = {'metric_id': metric['id']}
stack_identifier = self.stack_create(template=self.template,
parameters=parameters)
measures = [{'timestamp': timeutils.isotime(datetime.datetime.now()),
'value': 100}, {'timestamp': timeutils.isotime(
measures = [{'timestamp': test.isotime(datetime.datetime.now()),
'value': 100}, {'timestamp': test.isotime(
datetime.datetime.now() + datetime.timedelta(
minutes=1)), 'value': 100}]
# send measures(should cause the alarm to fire)