[Erp5-report] r34524 luke - /erp5/trunk/utils/erp5.timmy/src/erp5/timmy/timmy.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Apr 13 18:29:14 CEST 2010
Author: luke
Date: Tue Apr 13 18:29:11 2010
New Revision: 34524
URL: http://svn.erp5.org?rev=34524&view=rev
Log:
- run plugin init without arguments
Modified:
erp5/trunk/utils/erp5.timmy/src/erp5/timmy/timmy.py
Modified: erp5/trunk/utils/erp5.timmy/src/erp5/timmy/timmy.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.timmy/src/erp5/timmy/timmy.py?rev=34524&r1=34523&r2=34524&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.timmy/src/erp5/timmy/timmy.py [utf8] (original)
+++ erp5/trunk/utils/erp5.timmy/src/erp5/timmy/timmy.py [utf8] Tue Apr 13 18:29:11 2010
@@ -208,20 +208,21 @@
return 'reportUnknown', 'Report message is not implemented for plugin on'\
' client side.'
- def __init__(self, partition_id, item_id, partition_type):
- self.item_id = item_id
- self.partition_id = partition_id
- self.partition_type = partition_type.replace(' ', '')
+ def __init__(self, partition_dict):
+ self.item_id = partition_dict['ID']
+ self.partition_id = partition_dict['PARTITION_ID']
+ self.partition_type = partition_dict['TYPE'].replace(' ', '')
+ self.partition_dict = partition_dict
plugin_init = getattr(self, '%s' % self.partition_type, None)
if plugin_init is None:
# plugin not supported, create dummy method doing nothing
logging.warning('Partition management plugin for %s not found, '
- 'generating dummy one' % partition_type)
+ 'generating dummy one' % self.partition_type)
for method in 'install', 'start', 'stop', 'getPartitionState':
setattr(self, '%s_%s' % (method, self.partition_type),
self.notImplemented)
else:
- plugin_init(item_id)
+ plugin_init()
def install(self):
return getattr(self, 'install_%s' % self.partition_type)()
@@ -236,7 +237,7 @@
return getattr(self, 'getPartitionState_%s' % self.partition_type)()
# Specific code - candidates for plugins
- def Computer(self, *args, **kwargs):
+ def Computer(self):
pass
def install_Computer(self):
@@ -252,7 +253,7 @@
return 'reportStarted', 'timmy was able to operate on running computer'
# Mysql Server
- def MysqlServer(self, item_id):
+ def MysqlServer(self):
self.control_script = SUPERVISORCTL
def install_MysqlServer(self):
@@ -268,7 +269,7 @@
return self.getPartitionState_Supervised('mysql')
# Conversion Server
- def ConversionServer(self, item_id):
+ def ConversionServer(self):
self.control_script = SUPERVISORCTL
def install_ConversionServer(self):
@@ -299,8 +300,8 @@
return self.getPartitionState_Supervised('oood')
# Zope Instance related
- def ZopeInstance(self, item_id):
- self.control_script = os.path.join('var', item_id, 'bin', 'zopectl')
+ def ZopeInstance(self):
+ self.control_script = os.path.join('var', self.item_id, 'bin', 'zopectl')
def _zopectl_subprocess(self, action):
if not os.path.exists(self.control_script):
@@ -532,8 +533,7 @@
# stop
# switch to special management
# start
- partition = Partition(partition_dict['PARTITION_ID'],
- partition_dict['ID'], partition_dict['TYPE'])
+ partition = Partition(partition_dict)
switcher_dict = dict(
start = 'manageStart',
stop = 'manageStop',
More information about the Erp5-report
mailing list