forked from triaquae/CrazyEye
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
666 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
#for celery | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
# This will make sure the app is always imported when | ||
# Django starts so that shared_task will use this app. | ||
from .celery import app as celery_app | ||
|
||
__all__ = ['celery_app'] | ||
|
||
|
||
import pymysql | ||
pymysql.install_as_MySQLdb() | ||
pymysql.install_as_MySQLdb() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#_*_coding:utf-8_*_ | ||
from __future__ import absolute_import, unicode_literals | ||
import os | ||
from celery import Celery | ||
|
||
# set the default Django settings module for the 'celery' program. | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CrazyEye.settings') | ||
|
||
app = Celery('CrazyEye') | ||
|
||
# Using a string here means the worker don't have to serialize | ||
# the configuration object to child processes. | ||
# - namespace='CELERY' means all celery-related configuration keys | ||
# should have a `CELERY_` prefix. | ||
app.config_from_object('django.conf:settings', namespace='CELERY') | ||
|
||
# Load task modules from all registered Django app configs. | ||
app.autodiscover_tasks() | ||
|
||
|
||
@app.task(bind=True) | ||
def debug_task(self): | ||
print('Request: {0!r}'.format(self.request)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
from django.contrib import admin | ||
|
||
from bernard import models | ||
# Register your models here. | ||
|
||
|
||
class SchedulLogAdmin(admin.ModelAdmin): | ||
list_display = ('plan','status','start_date','end_date') | ||
|
||
|
||
#admin.site.register(models.Schedule) | ||
admin.site.register(models.Plan) | ||
admin.site.register(models.Stage) | ||
admin.site.register(models.Job) | ||
admin.site.register(models.SCPTask) | ||
admin.site.register(models.SSHTask) | ||
admin.site.register(models.ScheduleLog,SchedulLogAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.2 on 2017-02-09 09:43 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bernard', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='schedule', | ||
name='plan', | ||
), | ||
migrations.RemoveField( | ||
model_name='schedule', | ||
name='schedule', | ||
), | ||
migrations.DeleteModel( | ||
name='Schedule', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.2 on 2017-02-10 07:26 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bernard', '0002_auto_20170209_1743'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='scptask', | ||
name='job', | ||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='bernard.Job'), | ||
), | ||
migrations.AlterField( | ||
model_name='sshtask', | ||
name='job', | ||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='bernard.Job'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.2 on 2017-02-14 10:15 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bernard', '0003_auto_20170210_1526'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ScheduleLog', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('status', models.BooleanField(choices=[(0, 'failed'), (1, 'success'), (2, 'error'), (3, 'running')])), | ||
('date', models.DateTimeField(auto_now_add=True)), | ||
('plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bernard.Plan')), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.2 on 2017-02-15 02:16 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bernard', '0004_schedulelog'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='schedulelog', | ||
name='status', | ||
field=models.SmallIntegerField(choices=[(0, 'failed'), (1, 'success'), (2, 'error'), (3, 'running')]), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.2 on 2017-02-15 06:42 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bernard', '0005_auto_20170215_1016'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='schedulelog', | ||
old_name='date', | ||
new_name='start_date', | ||
), | ||
migrations.AddField( | ||
model_name='schedulelog', | ||
name='end_date', | ||
field=models.DateTimeField(auto_now=True), | ||
), | ||
migrations.AddField( | ||
model_name='schedulelog', | ||
name='errors', | ||
field=models.TextField(blank=True, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.