mirror of
https://github.com/ansible/awx.git
synced 2024-10-27 09:25:10 +03:00
from six.moves import xrange for Python 3
This commit is contained in:
parent
1ccdb305e3
commit
e1a8b69736
@ -29,6 +29,8 @@ import threading
|
||||
import uuid
|
||||
import memcache
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
__all__ = ['event_context']
|
||||
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
# Django
|
||||
from django.conf import settings
|
||||
|
||||
|
@ -5,6 +5,7 @@ import json
|
||||
import os
|
||||
import six
|
||||
from datetime import timedelta
|
||||
from six.moves import xrange
|
||||
|
||||
# Django
|
||||
from django.core.urlresolvers import resolve
|
||||
|
@ -1,6 +1,8 @@
|
||||
import pytest
|
||||
|
||||
from datetime import timedelta
|
||||
from six.moves import xrange
|
||||
|
||||
from django.utils import timezone
|
||||
|
||||
from awx.main.models import Fact
|
||||
@ -19,7 +21,7 @@ def setup_common(hosts, fact_scans, ts_from=None, ts_to=None, epoch=timezone.now
|
||||
continue
|
||||
facts_known.append(f)
|
||||
fact_objs = Fact.get_timeline(hosts[0].id, module=module_name, ts_from=ts_from, ts_to=ts_to)
|
||||
return (facts_known, fact_objs)
|
||||
return (facts_known, fact_objs)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@ -27,7 +29,7 @@ def test_all(hosts, fact_scans, monkeypatch_jsonbfield_get_db_prep_save):
|
||||
epoch = timezone.now()
|
||||
ts_from = epoch - timedelta(days=1)
|
||||
ts_to = epoch + timedelta(days=10)
|
||||
|
||||
|
||||
(facts_known, fact_objs) = setup_common(hosts, fact_scans, ts_from, ts_to, module_name=None, epoch=epoch)
|
||||
assert 9 == len(facts_known)
|
||||
assert 9 == len(fact_objs)
|
||||
@ -53,7 +55,7 @@ def test_empty_db(hosts, fact_scans, monkeypatch_jsonbfield_get_db_prep_save):
|
||||
epoch = timezone.now()
|
||||
ts_from = epoch - timedelta(days=1)
|
||||
ts_to = epoch + timedelta(days=10)
|
||||
|
||||
|
||||
fact_objs = Fact.get_timeline(hosts[0].id, 'ansible', ts_from, ts_to)
|
||||
|
||||
assert 0 == len(fact_objs)
|
||||
@ -64,7 +66,7 @@ def test_no_results(hosts, fact_scans, monkeypatch_jsonbfield_get_db_prep_save):
|
||||
epoch = timezone.now()
|
||||
ts_from = epoch - timedelta(days=100)
|
||||
ts_to = epoch - timedelta(days=50)
|
||||
|
||||
|
||||
(facts_known, fact_objs) = setup_common(hosts, fact_scans, ts_from, ts_to, epoch=epoch)
|
||||
assert 0 == len(fact_objs)
|
||||
|
||||
|
@ -5,6 +5,8 @@ from requests.adapters import HTTPAdapter
|
||||
from requests.utils import select_proxy
|
||||
from requests.exceptions import ConnectionError
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
from awx.api.versioning import reverse
|
||||
from awx.main.models.notifications import NotificationTemplate, Notification
|
||||
from awx.main.models.inventory import Inventory, InventorySource
|
||||
|
@ -3,6 +3,8 @@ import pytest
|
||||
import mock
|
||||
import json
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
# AWX
|
||||
from awx.api.serializers import (
|
||||
JobSerializer,
|
||||
|
@ -2,6 +2,8 @@
|
||||
import pytest
|
||||
import mock
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
# AWX
|
||||
from awx.api.serializers import (
|
||||
JobTemplateSerializer,
|
||||
|
@ -3,6 +3,8 @@ import base64
|
||||
import json
|
||||
from StringIO import StringIO
|
||||
|
||||
from six.moves import xrange
|
||||
|
||||
from awx.main.utils import OutputEventFilter
|
||||
|
||||
MAX_WIDTH = 78
|
||||
|
Loading…
Reference in New Issue
Block a user