完成cron和sudo的list和detail基础,ansible Task接口更上层抽象中

This commit is contained in:
yumaojun03
2016-12-19 00:24:51 +08:00
parent b348f7f1ce
commit 86c5f0d3d3
10 changed files with 689 additions and 266 deletions

View File

@@ -4,10 +4,12 @@ from __future__ import unicode_literals, absolute_import
import logging
import json
from assets.models import Asset
from django.db import models
from django.utils.translation import ugettext_lazy as _
__all__ = ["Tasker", "AnsiblePlay", "AnsibleTask", "AnsibleHostResult"]
__all__ = ["Task", "Tasker", "AnsiblePlay", "AnsibleTask", "AnsibleHostResult"]
logger = logging.getLogger(__name__)
@@ -290,11 +292,9 @@ class AnsibleHostResult(models.Model):
print('Error: %s, continue...' % e.message)
continue
class Task(models.Model):
name = models.CharField(max_length=128, blank=True, verbose_name=_('Name'))
asset = models.ForeignKey(Asset, null=True, blank=True, related_name='crontables')
def __unicode__(self):
pass