mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Fix newly-added black rules
This commit is contained in:
@@ -862,7 +862,7 @@ class UnifiedJobSerializer(BaseSerializer):
|
|||||||
if 'elapsed' in ret:
|
if 'elapsed' in ret:
|
||||||
if obj and obj.pk and obj.started and not obj.finished:
|
if obj and obj.pk and obj.started and not obj.finished:
|
||||||
td = now() - obj.started
|
td = now() - obj.started
|
||||||
ret['elapsed'] = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / (10 ** 6 * 1.0)
|
ret['elapsed'] = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / (10**6 * 1.0)
|
||||||
ret['elapsed'] = float(ret['elapsed'])
|
ret['elapsed'] = float(ret['elapsed'])
|
||||||
# Because this string is saved in the db in the source language,
|
# Because this string is saved in the db in the source language,
|
||||||
# it must be marked for translation after it is pulled from the db, not when set
|
# it must be marked for translation after it is pulled from the db, not when set
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ def random_ipv4():
|
|||||||
|
|
||||||
def random_ipv6():
|
def random_ipv6():
|
||||||
"""Generates a random ipv6 address;; useful for testing."""
|
"""Generates a random ipv6 address;; useful for testing."""
|
||||||
return ':'.join('{0:x}'.format(random.randint(0, 2 ** 16 - 1)) for i in range(8))
|
return ':'.join('{0:x}'.format(random.randint(0, 2**16 - 1)) for i in range(8))
|
||||||
|
|
||||||
|
|
||||||
def random_loopback_ip():
|
def random_loopback_ip():
|
||||||
|
|||||||
Reference in New Issue
Block a user