Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 3
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
Ejemplo n.º 4
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
Ejemplo n.º 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
Ejemplo n.º 6
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
Ejemplo n.º 7
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)
Ejemplo n.º 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)
Ejemplo n.º 9
0
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]
Ejemplo n.º 10
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)