FoundationDB / fdb-joshua

FoundationDB Correctness service
Apache License 2.0
28 stars 25 forks source link

Fix timedelta not found bug #53

Closed xumengpanda closed 3 years ago

xumengpanda commented 3 years ago

datetime can be a package or object. We need to avoid using datetime when use timedelta objet.

Otherwise, I got the following error

# python3 -m joshua.joshua list --stop
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/opt/rh/rh-python38/root/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/opt/rh/rh-python38/root/usr/lib64/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/root/src/fdb-joshua/joshua/joshua.py", line 53, in list_active_ensembles
    ensemble_list = get_active_ensembles(stopped, sanity, username)
  File "/root/src/fdb-joshua/joshua/joshua.py", line 49, in get_active_ensembles
    return joshua_model.get_active_ensembles(stopped, sanity, username)
  File "/root/src/fdb-joshua/joshua/joshua_model.py", line 463, in get_active_ensembles
    datetime.timedelta(
AttributeError: type object 'datetime.datetime' has no attribute 'timedelta'
xumengpanda commented 3 years ago

It's verified on okteto with @jzhou77

ammolitor commented 3 years ago

This has been fixed in #56, closing.