Skip to content

Commit

Permalink
removing the behavior of generating an exit code >0 if there were any…
Browse files Browse the repository at this point in the history
… data on stderr

now, the exit code will be controlled with the last command of the script/command executed (similar of what Rundeck works on Linux)
  • Loading branch information
ltamaster committed Jun 18, 2019
1 parent 6f6710c commit 70cbb92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 6 additions & 3 deletions contents/winrm-exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
if os.environ.get('RD_JOB_LOGLEVEL') == 'DEBUG':
log_level = 'DEBUG'
else:
log_level = 'ERROR'
log_level = 'WARNING'

##end

Expand Down Expand Up @@ -263,8 +263,11 @@
sys.stdout = realstdout
sys.stderr = realstderr

if tsk.e_std:
log.error("Execution finished with the following error")
if tsk.stat ==0 and tsk.e_std:
#printing sterr when the exit code is cero
log.warning(tsk.e_std)

if tsk.stat !=0:
log.error(tsk.e_std)
sys.exit(1)
else:
Expand Down
10 changes: 1 addition & 9 deletions plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
name: py-winrm-plugin
rundeckPluginVersion: 2.0
rundeckPluginVersion: 1.2
author: "@author@"
date: "@date@"
version: "@version@"
url: "@url@"
description: "Python WINRM node executor and file copier"
rundeckCompatibilityVersion: "3.x"
targetHostCompatibility: "all"
license: "Apache 2.0"
tags:
- script
- NodeExecutor
- FileCopier
providers:
- name: WinRMPython
title: WinRM Node Executor Python
Expand Down

0 comments on commit 70cbb92

Please sign in to comment.