Adjusted defaults in actions

This commit is contained in:
Jedrzej Nowak
2015-08-28 20:10:10 +02:00
parent a3783c8171
commit cdd13f3094

View File

@@ -2,15 +2,17 @@
import handlers
from solar.core.transports.ssh import SSHSyncTransport, SSHRunTransport
# from solar.core.transports.rsync import RsyncSyncTransport
_default_transports = {
'sync': SSHSyncTransport,
# 'sync': RsyncSyncTransport,
'run': SSHRunTransport
}
def resource_action(resource, action):
handler = resource.metadata.get('handler', 'none')
with handlers.get(handler)([resource]) as h:
with handlers.get(handler)([resource], _default_transports) as h:
return h.action(resource, action)