make delegate_to localhost act like local_action

This commit is contained in:
Jonathan Palley 2012-09-26 02:57:00 +08:00
parent f8a9541405
commit 620accf117

View file

@ -62,6 +62,11 @@ class Task(object):
self.action = ds.get('local_action', '')
self.delegate_to = '127.0.0.1'
self.transport = 'local'
# delegate_to: localhost should use local transport
elif (ds.get('delegate_to', None) in ['127.0.0.1', 'localhost']):
self.action = ds.get('action', '')
self.delegate_to = '127.0.0.1'
self.transport = 'local'
else:
self.action = ds.get('action', '')
self.delegate_to = ds.get('delegate_to', None)