Commit 09748757 authored by Marco Mariani's avatar Marco Mariani

realRun() now handles a single method

parent d03a91a3
...@@ -334,7 +334,7 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple): ...@@ -334,7 +334,7 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
options]) options])
def realRun(argument_tuple, method_list): def realRun(argument_tuple, method):
slapgrid_object, options = \ slapgrid_object, options = \
parseArgumentTupleAndReturnSlapgridObject(*argument_tuple) parseArgumentTupleAndReturnSlapgridObject(*argument_tuple)
pidfile = options.get('pidfile') pidfile = options.get('pidfile')
...@@ -343,13 +343,12 @@ def realRun(argument_tuple, method_list): ...@@ -343,13 +343,12 @@ def realRun(argument_tuple, method_list):
try: try:
failed = False failed = False
failed_promise = False failed_promise = False
for method in method_list: # Quite complicated way to figure out if everything went fine
# Quite complicated way to figure out if everything went fine return_value = getattr(slapgrid_object, method)()
return_value = getattr(slapgrid_object, method)() if return_value == SLAPGRID_FAIL:
if return_value == SLAPGRID_FAIL: failed = True
failed = True if return_value == SLAPGRID_PROMISE_FAIL:
if return_value == SLAPGRID_PROMISE_FAIL: failed_promise = True
failed_promise = True
finally: finally:
if pidfile: if pidfile:
setFinished(pidfile) setFinished(pidfile)
...@@ -363,19 +362,19 @@ def realRun(argument_tuple, method_list): ...@@ -363,19 +362,19 @@ def realRun(argument_tuple, method_list):
def runSoftwareRelease(*argument_tuple): def runSoftwareRelease(*argument_tuple):
"""Hook for entry point to process Software Releases only """Hook for entry point to process Software Releases only
""" """
realRun(argument_tuple, ['processSoftwareReleaseList']) realRun(argument_tuple, 'processSoftwareReleaseList')
def runComputerPartition(*argument_tuple): def runComputerPartition(*argument_tuple):
"""Hook for entry point to process Computer Partitions only """Hook for entry point to process Computer Partitions only
""" """
realRun(argument_tuple, ['processComputerPartitionList']) realRun(argument_tuple, 'processComputerPartitionList')
def runUsageReport(*argument_tuple): def runUsageReport(*argument_tuple):
"""Hook for entry point to process Usage Reports only """Hook for entry point to process Usage Reports only
""" """
realRun(argument_tuple, ['agregateAndSendUsage']) realRun(argument_tuple, 'agregateAndSendUsage')
class Slapgrid(object): class Slapgrid(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment