Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
itminedu
snf-ganeti
Commits
437138c9
Commit
437138c9
authored
16 years ago
by
Michael Hanselmann
Browse files
Options
Downloads
Patches
Plain Diff
Convert mcpu.py
Replacing ssconf with configuration. Reviewed-by: iustinp
parent
5b263ed7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/mcpu.py
+4
-6
4 additions, 6 deletions
lib/mcpu.py
test/mocks.py
+6
-0
6 additions, 0 deletions
test/mocks.py
with
10 additions
and
6 deletions
lib/mcpu.py
+
4
−
6
View file @
437138c9
...
...
@@ -287,9 +287,9 @@ class HooksMaster(object):
env
=
self
.
env
.
copy
()
env
[
"
GANETI_HOOKS_PHASE
"
]
=
phase
env
[
"
GANETI_HOOKS_PATH
"
]
=
hpath
if
self
.
lu
.
sstore
is
not
None
:
env
[
"
GANETI_CLUSTER
"
]
=
self
.
lu
.
sstore
.
GetClusterName
()
env
[
"
GANETI_MASTER
"
]
=
self
.
lu
.
sstore
.
GetMasterNode
()
if
self
.
lu
.
cfg
is
not
None
:
env
[
"
GANETI_CLUSTER
"
]
=
self
.
lu
.
cfg
.
GetClusterName
()
env
[
"
GANETI_MASTER
"
]
=
self
.
lu
.
cfg
.
GetMasterNode
()
env
=
dict
([(
str
(
key
),
str
(
val
))
for
key
,
val
in
env
.
iteritems
()])
...
...
@@ -340,7 +340,5 @@ class HooksMaster(object):
"""
phase
=
constants
.
HOOKS_PHASE_POST
hpath
=
constants
.
HOOKS_NAME_CFGUPDATE
if
self
.
lu
.
sstore
is
None
:
raise
errors
.
ProgrammerError
(
"
Null sstore on config update hook
"
)
nodes
=
[
self
.
lu
.
sstore
.
GetMasterNode
()]
nodes
=
[
self
.
lu
.
cfg
.
GetMasterNode
()]
results
=
self
.
_RunWrapper
(
nodes
,
hpath
,
phase
)
This diff is collapsed.
Click to expand it.
test/mocks.py
+
6
−
0
View file @
437138c9
...
...
@@ -48,6 +48,12 @@ class FakeConfig:
def
GetHostKey
(
self
):
return
FAKE_CLUSTER_KEY
def
GetClusterName
(
self
):
return
"
test.cluster
"
def
GetMasterNode
(
self
):
return
utils
.
HostInfo
().
name
class
FakeSStore
:
"""
Fake simplestore object
"""
...
...
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