# Path: muparse/models.py
# class MuninNodes(models.Model):
#     name = models.CharField(max_length=255)
#     url = models.URLField(max_length=255)
#     cgi_path = models.CharField(max_length=255)
#     image_path = models.CharField(max_length=255, blank=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def as_dict(self):
#         return {
#             'name': self.name,
#             'url': self.url,
#             'cgi_path': self.cgi_path,
#             'image_path': self.image_path
#         }
# 
#     class Meta:
#         verbose_name_plural = "Munin Node"
#         verbose_name_plural = "Munin Nodes"


from django.conf import settings
from muparse.models import MuninNodes
from django.core.exceptions import ImproperlyConfigured
import requests


def get_all_nodes():
    MNODES = []
    for node in settings.MUNIN_NODES:
        if isinstance(node, tuple):
            MNODES.append(node)
        else:
            raise ImproperlyConfigured('Munin node should be a tupple')

# Path: muparse/models.py
# class MuninNodes(models.Model):
#     name = models.CharField(max_length=255)
#     url = models.URLField(max_length=255)
#     cgi_path = models.CharField(max_length=255)
#     image_path = models.CharField(max_length=255, blank=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def as_dict(self):
#         return {
#             'name': self.name,
#             'url': self.url,
#             'cgi_path': self.cgi_path,
#             'image_path': self.image_path
#         }
# 
#     class Meta:
#         verbose_name_plural = "Munin Node"
#         verbose_name_plural = "Munin Nodes"


# Path: muparse/management/commands/utils.py
from django.conf import settings
from muparse.models import MuninNodes
from django.core.exceptions import ImproperlyConfigured
import requests



def get_all_nodes():
    MNODES = []
    for node in settings.MUNIN_NODES:
        if isinstance(node, tuple):
            MNODES.append(node)
        else:
            raise ImproperlyConfigured('Munin node should be a tupple')

    for node in MuninNodes.objects.all():