|
@@ -25,6 +25,8 @@ class Waller(Connection):
|
|
:param kwargs:
|
|
:param kwargs:
|
|
:return:
|
|
:return:
|
|
'''
|
|
'''
|
|
|
|
+ message = 'deploying task_id=%s [%s@%s]$ %s ' % (wenv['task_id'], self.user, self.host, command)
|
|
|
|
+ current_app.logger.info(message)
|
|
try:
|
|
try:
|
|
message = 'task_id=%s, host:%s command:%s' % (
|
|
message = 'task_id=%s, host:%s command:%s' % (
|
|
wenv['task_id'], self.host, command
|
|
wenv['task_id'], self.host, command
|
|
@@ -68,7 +70,7 @@ class Waller(Connection):
|
|
RecordModel().save_record(stage=wenv['stage'], sequence=wenv['sequence'], user_id=wenv['user_id'],
|
|
RecordModel().save_record(stage=wenv['stage'], sequence=wenv['sequence'], user_id=wenv['user_id'],
|
|
task_id=wenv['task_id'], status=1, host=self.host, user=self.user,
|
|
task_id=wenv['task_id'], status=1, host=self.host, user=self.user,
|
|
command=command, success='', error=error)
|
|
command=command, success='', error=error)
|
|
- if hasattr(e, 'resean') and hasattr(e, 'result'):
|
|
|
|
|
|
+ if hasattr(e, 'reason') and hasattr(e, 'result'):
|
|
message = 'task_id=%s, host:%s command:%s, status=1, reason:%s, result:%s' % (
|
|
message = 'task_id=%s, host:%s command:%s, status=1, reason:%s, result:%s' % (
|
|
wenv['task_id'], self.host, command, e.reason, error
|
|
wenv['task_id'], self.host, command, e.reason, error
|
|
)
|
|
)
|
|
@@ -107,6 +109,8 @@ class Waller(Connection):
|
|
def sync(self, wtype, remote=None, local=None, wenv=None):
|
|
def sync(self, wtype, remote=None, local=None, wenv=None):
|
|
command = 'put: scp %s %s@%s:%s' % (local, self.user, self.host, remote) if wtype == 'put' \
|
|
command = 'put: scp %s %s@%s:%s' % (local, self.user, self.host, remote) if wtype == 'put' \
|
|
else 'get: scp %s@%s:%s %s' % (self.user, self.host, remote, local)
|
|
else 'get: scp %s@%s:%s %s' % (self.user, self.host, remote, local)
|
|
|
|
+ message = 'deploying task_id=%s [%s@%s]$ %s ' % (wenv['task_id'], self.user, self.host, command)
|
|
|
|
+ current_app.logger.info(message)
|
|
|
|
|
|
try:
|
|
try:
|
|
if wtype == 'put':
|
|
if wtype == 'put':
|
|
@@ -160,4 +164,3 @@ class Waller(Connection):
|
|
}
|
|
}
|
|
if wenv['console']:
|
|
if wenv['console']:
|
|
emit('console', {'event': 'task:console', 'data': ws_dict}, room=wenv['task_id'])
|
|
emit('console', {'event': 'task:console', 'data': ws_dict}, room=wenv['task_id'])
|
|
-
|
|
|