1 6
from django.core.management.base import BaseCommand
2 6
from django.core.management import call_command
3 6
from crum import impersonate
4 6
from django.contrib.auth import get_user_model
5 6
from cyborgbackup.main import consumers
6

7

8 6
class Command(BaseCommand):
9
    """Create preloaded data, intended for new installs
10
    """
11 6
    help = 'Creates a preload tower data iff there is none.'
12

13 6
    def handle(self, *args, **kwargs):
14 0
        i=6
15 0
        while i < 200:
16 0
            consumers.emit_channel_notification("job_events-4", {"id": 16139540,
17
                "type": "job_event",
18
                "url": "/api/v1/job_events/16139540/",
19
                "related": {"job": "/api/v1/jobs/38631/"},
20
                "summary_fields": {
21
                    "job": {
22
                        "id": 4,
23
                        "name": "Backup Job Backup Mail from Knet knet.milkywan.cloud",
24
                        "status": "running",
25
                        "failed": False,
26
                        "elapsed": "0.000"
27
                    }
28
                },
29
                "created": "2020-04-11T17:50:38.159331+00:00",
30
                "modified": "2020-04-11T17:50:38.159340+00:00",
31
                "job": 4,
32
                "event": "verbose",
33
                "counter": i,
34
                "event_display":
35
                "Verbose",
36
                "event_data": {},
37
                "event_level": 0,
38
                "failed": False,
39
                "changed": False,
40
                "uuid": "",
41
                "task": "",
42
                "stdout": "Merging into master chunks insddex {}...".format(i),
43
                "start_line": 8,
44
                "end_line": 9,
45
                "verbosity": 0,
46
                "event_name": "verbose",
47
                "group_name": "job_events"
48
            })
49 0
            i = i+1

Read our documentation on viewing source code .

Loading