changes to remove the need to pass services separately, when the node has access to them directly, also made a couple CoreServices methods more consistent to have the node as first param and service second
This commit is contained in:
parent
b868454b5e
commit
0aca9d7809
11 changed files with 123 additions and 147 deletions
|
@ -20,23 +20,23 @@ class Ucarp(CoreService):
|
|||
validate = ("pidof ucarp",)
|
||||
|
||||
@classmethod
|
||||
def generateconfig(cls, node, filename, services):
|
||||
def generateconfig(cls, node, filename):
|
||||
"""
|
||||
Return the default file contents
|
||||
"""
|
||||
if filename == cls.configs[0]:
|
||||
return cls.generateUcarpConf(node, services)
|
||||
return cls.generateUcarpConf(node)
|
||||
elif filename == cls.configs[1]:
|
||||
return cls.generateVipUp(node, services)
|
||||
return cls.generateVipUp(node)
|
||||
elif filename == cls.configs[2]:
|
||||
return cls.generateVipDown(node, services)
|
||||
return cls.generateVipDown(node)
|
||||
elif filename == cls.configs[3]:
|
||||
return cls.generateUcarpBoot(node, services)
|
||||
return cls.generateUcarpBoot(node)
|
||||
else:
|
||||
raise ValueError
|
||||
|
||||
@classmethod
|
||||
def generateUcarpConf(cls, node, services):
|
||||
def generateUcarpConf(cls, node):
|
||||
"""
|
||||
Returns configuration file text.
|
||||
"""
|
||||
|
@ -105,7 +105,7 @@ ${UCARP_EXEC} -B ${UCARP_OPTS}
|
|||
""" % (ucarp_bin, UCARP_ETC)
|
||||
|
||||
@classmethod
|
||||
def generateUcarpBoot(cls, node, services):
|
||||
def generateUcarpBoot(cls, node):
|
||||
"""
|
||||
Generate a shell script used to boot the Ucarp daemons.
|
||||
"""
|
||||
|
@ -127,7 +127,7 @@ ${UCARP_CFGDIR}/default.sh
|
|||
""" % UCARP_ETC
|
||||
|
||||
@classmethod
|
||||
def generateVipUp(cls, node, services):
|
||||
def generateVipUp(cls, node):
|
||||
"""
|
||||
Generate a shell script used to start the virtual ip
|
||||
"""
|
||||
|
@ -154,7 +154,7 @@ fi
|
|||
"""
|
||||
|
||||
@classmethod
|
||||
def generateVipDown(cls, node, services):
|
||||
def generateVipDown(cls, node):
|
||||
"""
|
||||
Generate a shell script used to stop the virtual ip
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue