Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
salt-observer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
django
salt-observer
Commits
f6fd5769
Commit
f6fd5769
authored
8 years ago
by
Tim Fechner
Browse files
Options
Downloads
Patches
Plain Diff
Close
#22
, make everything configurable
parent
4724988f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
salt_observer/cherry.py
+3
-1
3 additions, 1 deletion
salt_observer/cherry.py
salt_observer/private_settings.example.py
+11
-0
11 additions, 0 deletions
salt_observer/private_settings.example.py
salt_observer/views.py
+1
-1
1 addition, 1 deletion
salt_observer/views.py
with
15 additions
and
2 deletions
salt_observer/cherry.py
+
3
−
1
View file @
f6fd5769
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
'''
...
...
This diff is collapsed.
Click to expand it.
salt_observer/private_settings.example.py
+
11
−
0
View file @
f6fd5769
...
@@ -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
'
This diff is collapsed.
Click to expand it.
salt_observer/views.py
+
1
−
1
View file @
f6fd5769
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment