Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IPMI Power Control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Klimt
IPMI Power Control
Commits
5ae3dc98
Commit
5ae3dc98
authored
4 months ago
by
Jonathan Klimt
Browse files
Options
Downloads
Patches
Plain Diff
Added check for duplicate IPMI addresses
parent
13e1e4eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app.py
+5
-0
5 additions, 0 deletions
app.py
with
5 additions
and
0 deletions
app.py
+
5
−
0
View file @
5ae3dc98
...
...
@@ -67,8 +67,12 @@ class ServerManager:
try
:
with
open
(
'
servers.json
'
,
'
r
'
)
as
f
:
self
.
groups
=
json
.
load
(
f
)
# The file contains an array of groups directly
ipmi_ips
=
set
()
for
group
in
self
.
groups
:
for
server
in
group
[
'
servers
'
]:
if
server
[
'
ipmi_ip
'
]
in
ipmi_ips
:
raise
ValueError
(
f
"
Duplicate IPMI IP address found in servers.json:
{
server
[
'
ipmi_ip
'
]
}
"
)
ipmi_ips
.
add
(
server
[
'
ipmi_ip
'
])
self
.
servers
[
f
"
{
group
[
'
name
'
]
}
/
{
server
[
'
name
'
]
}
"
]
=
{
'
config
'
:
server
,
'
connection
'
:
None
,
...
...
@@ -78,6 +82,7 @@ class ServerManager:
logger
.
error
(
f
"
Failed to load server configuration:
{
str
(
e
)
}
"
)
self
.
servers
=
{}
self
.
groups
=
[]
raise
# Re-raise the exception to prevent the application from starting with invalid configuration
def
initialize_connections
(
self
)
->
None
:
for
server_name
,
server_data
in
self
.
servers
.
items
():
...
...
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