Skip to content
Snippets Groups Projects
Commit f6fd5769 authored by Tim Fechner's avatar Tim Fechner
Browse files

Close #22, make everything configurable

parent 4724988f
No related branches found
No related tags found
No related merge requests found
from django.conf import settings
import requests import requests
from getpass import getpass from getpass import getpass
class SaltCherrypyApi(object): class SaltCherrypyApi(object):
BASE_URL = 'http://localhost:8989' BASE_URL = '{protocol}://{host}:{port}'.format(**settings.SALT_API)
def __init__(self, username, password): def __init__(self, username, password):
''' Log in every time an instance is created ''' ''' Log in every time an instance is created '''
......
...@@ -22,3 +22,14 @@ DATABASES = { ...@@ -22,3 +22,14 @@ DATABASES = {
'NAME': os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'db.sqlite3'), 'NAME': os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'db.sqlite3'),
} }
} }
# Salt observer configuration
SALT_API = {
'host': 'localhost',
'port': 8989,
'protocol': 'http',
}
# specify your salt network here to disable it in network visualization
SALT_NETWORK = '123.456.789.0'
...@@ -85,7 +85,7 @@ class VisualNetwork(TemplateView): ...@@ -85,7 +85,7 @@ class VisualNetwork(TemplateView):
ctx = super().get_context_data(*args, **kwargs) ctx = super().get_context_data(*args, **kwargs)
ctx.update({ ctx.update({
'minions': Minion.objects.all(), 'minions': Minion.objects.all(),
'networks': Network.objects.all().exclude(ipv4='10.1.10.0'), 'networks': Network.objects.all().exclude(ipv4=settings.SALT_NETWORK),
}) })
return ctx return ctx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment