1030 OM patch
This commit is contained in:
@ -38,5 +38,47 @@ class CM(BaseComponent):
|
||||
self.level = 2
|
||||
|
||||
|
||||
class CmResAttr():
|
||||
|
||||
def __init__(self, script, res_type='DN'):
|
||||
self.resources_type = res_type
|
||||
self.script = script
|
||||
self.check_interval = 1
|
||||
self.time_out = 120
|
||||
self.restart_times = 5
|
||||
self.restart_delay = 1
|
||||
self.restart_period = 1
|
||||
|
||||
def __str__(self):
|
||||
return str(vars(self)).replace(":", '=').replace('\'', '').replace(
|
||||
' ', '').replace('{', '"').replace('}', '"')
|
||||
|
||||
|
||||
class DssInstAttr():
|
||||
|
||||
def __init__(self, node_id, dss_id, dss_home):
|
||||
self.node_id = node_id
|
||||
self.res_instance_id = dss_id
|
||||
self.res_args = dss_home
|
||||
|
||||
def __str__(self):
|
||||
return str(vars(self)).replace(":", '=').replace('\'', '').replace(
|
||||
' ', '').replace('{', '"').replace('}', '"').replace(';', ' ')
|
||||
|
||||
|
||||
class CmResCtrlCmd():
|
||||
|
||||
def __init__(self, action='add', name='', attr=''):
|
||||
self.action = action
|
||||
self.attr_name = name
|
||||
self.attr = attr
|
||||
|
||||
def __str__(self):
|
||||
cmd = ''
|
||||
if self.action == 'add':
|
||||
cmd = 'cm_ctl res --add --res_name {} --res_attr={}'.format(
|
||||
self.attr_name, self.attr)
|
||||
elif self.action == 'edit':
|
||||
cmd = 'cm_ctl res --edit --res_name {} --add_inst={}'.format(
|
||||
self.attr_name, self.attr)
|
||||
return cmd
|
||||
|
Reference in New Issue
Block a user