forked from YoLoveLife/DevOps
-
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
1 parent
db149fc
commit 9277000
Showing
9 changed files
with
75 additions
and
48 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
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,6 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.test import TestCase | ||
|
||
# Create your tests here. | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.test import TestCase | ||
|
||
# Create your tests here. | ||
# DDR |
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,33 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
from django.conf import settings | ||
from manager.models import Group | ||
import uuid | ||
__all__ = [ | ||
"Variable", "Var2Group", | ||
] | ||
|
||
|
||
class Variable(models.Model): | ||
id = models.AutoField(primary_key=True) | ||
uuid = models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False) | ||
key = models.CharField(default='', max_length=30) | ||
value = models.CharField(default='', max_length=30) | ||
|
||
class Meta: | ||
ordering = ['id',] | ||
abstract = True | ||
|
||
|
||
class Var2Group(Variable): | ||
group = models.ForeignKey(Group, related_name='vars', null=True, on_delete=models.SET_NULL) | ||
|
||
class Meta: | ||
permissions = ( | ||
('yo_list_group_var', u'罗列组参数'), | ||
('yo_change_group_var', u'新增组参数'), | ||
('yo_delete_group_var', u'删除组参数'), | ||
) | ||
|
||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
from django.conf import settings | ||
from manager.models import Group | ||
import uuid | ||
__all__ = [ | ||
"Variable", "Var2Group", | ||
] | ||
|
||
|
||
class Variable(models.Model): | ||
id = models.AutoField(primary_key=True) | ||
uuid = models.UUIDField(auto_created=True, default=uuid.uuid4, editable=False) | ||
key = models.CharField(default='', max_length=100) | ||
value = models.CharField(default='', max_length=200) | ||
|
||
class Meta: | ||
ordering = ['id',] | ||
abstract = True | ||
|
||
|
||
class Var2Group(Variable): | ||
group = models.ForeignKey(Group, related_name='vars', null=True, on_delete=models.SET_NULL) | ||
|
||
class Meta: | ||
permissions = ( | ||
('yo_list_group_var', u'罗列组参数'), | ||
('yo_change_group_var', u'新增组参数'), | ||
('yo_delete_group_var', u'删除组参数'), | ||
) | ||
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
# Time 17-10-25 | ||
# Author Yo | ||
# Email [email protected] | ||
|
||
from __future__ import absolute_import, unicode_literals | ||
from celery.task import periodic_task | ||
from celery.schedules import crontab | ||
|
@@ -37,4 +36,4 @@ def dns_flush(): | |
for dns in DNS.objects.all().exclude(Q(father__isnull=True)|Q(father__father__isnull=True)): | ||
dns.inner_dig = reflush(dns,settings.INNER_DNS) | ||
dns.dig = reflush(dns,settings.OUTER_DNS) | ||
dns.save() | ||
dns.save() |
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