コード例 #1
0
def get_all_templates():
    all_templates = okconfig.get_templates()
    service_templates = filter(lambda x: 'host' not in x, all_templates)
    return map(
        lambda x: (x, _("Standard %(service_template)s checks") % {
            "service_template": x
        }), service_templates)
コード例 #2
0
 def clean(self):
     cleaned_data = super(AddTemplateForm,self).clean()
     force = self.cleaned_data.get('force')
     host_name = self.cleaned_data.get('host_name')
     templates = self.cleaned_data.get('templates')
     for i in templates:
         if i not in okconfig.get_templates().keys():
             self._errors['templates'] = self.error_class( ['template %s was not found'%i] )
     if not force and host_name not in okconfig.get_hosts():
         self._errors['host_name'] = self.error_class(['Host name not found Use force to write template anyway'])
     return cleaned_data
コード例 #3
0
ファイル: forms.py プロジェクト: andresriancho/adagios
 def clean(self):
     cleaned_data = super(AddTemplateForm,self).clean()
     force = self.cleaned_data.get('force')
     host_name = self.cleaned_data.get('host_name')
     templates = self.cleaned_data.get('templates')
     for i in templates:
         if i not in okconfig.get_templates().keys():
             self._errors['templates'] = self.error_class( ['template %s was not found'%i] )
     if not force and host_name not in okconfig.get_hosts():
         self._errors['host_name'] = self.error_class(['Host name not found Use force to write template anyway'])
     return cleaned_data
コード例 #4
0
ファイル: forms.py プロジェクト: spil-sean/adagios
 def clean(self):
     cleaned_data = super(AddHostForm, self).clean()
     force = self.cleaned_data.get("force")
     host_name = self.cleaned_data.get("host_name")
     templates = self.cleaned_data.get("templates")
     for i in templates:
         if i not in okconfig.get_templates().keys():
             self._errors["templates"] = self.error_class(["template %s was not found" % i])
     if not force and host_name in okconfig.get_hosts():
         self._errors["host_name"] = self.error_class(["Host name already exists. Use force to overwrite"])
     return cleaned_data
コード例 #5
0
 def clean(self):
     cleaned_data = super(AddHostForm, self).clean()
     force = self.cleaned_data.get('force')
     host_name = self.cleaned_data.get('host_name')
     templates = self.cleaned_data.get('templates')
     for i in templates:
         if i not in okconfig.get_templates().keys():
             self._errors['templates'] = self.error_class(
                 [_('template %s was not found') % i])
     if not force and host_name in okconfig.get_hosts():
         self._errors['host_name'] = self.error_class(
             [_('Host name already exists. Use force to overwrite')])
     return cleaned_data
コード例 #6
0
ファイル: forms.py プロジェクト: AccelerationNet/adagios
 def clean(self):
     cleaned_data = super(AddHostForm, self).clean()
     force = self.cleaned_data.get('force')
     host_name = self.cleaned_data.get('host_name')
     templates = self.cleaned_data.get('templates')
     for i in templates:
         if i not in okconfig.get_templates().keys():
             self._errors['templates'] = self.error_class(
                 [_('template %s was not found') % i])
     if not force and host_name in okconfig.get_hosts():
         self._errors['host_name'] = self.error_class(
             [_('Host name already exists. Use force to overwrite')])
     return cleaned_data
コード例 #7
0
ファイル: forms.py プロジェクト: davideagle/adagios
def get_all_templates():
    all_templates = okconfig.get_templates()
    service_templates = filter(lambda x: 'host' not in x, all_templates)
    return map(lambda x: (x, "Standard " + x + " checks"), service_templates)
コード例 #8
0
def get_all_templates():
    all_templates = okconfig.get_templates()
    service_templates = filter(lambda x: 'host' not in x, all_templates)
    return map(lambda x: (x, "Standard " + x + " checks"), service_templates)
コード例 #9
0
ファイル: forms.py プロジェクト: binRick/adagios
def get_all_templates():
    all_templates = okconfig.get_templates()
    service_templates = [x for x in all_templates if 'host' not in x]
    return [(x, _("Standard %(service_template)s checks") % {
        "service_template": x
    }) for x in service_templates]
コード例 #10
0
ファイル: forms.py プロジェクト: AccelerationNet/adagios
def get_all_templates():
    all_templates = okconfig.get_templates()
    service_templates = filter(lambda x: 'host' not in x, all_templates)
    return map(lambda x: (x, _("Standard %(service_template)s checks") % {"service_template": x}), service_templates)