Skip to content

Commit

Permalink
#402: debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
lrochette committed Oct 12, 2021
1 parent 99827b2 commit 2208a02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions incubating/service-now/lib/snow.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def checkSysid(sysid):
print(" CR_SYSID: %s" % (sysid))

if ( sysid == None ):
sys.exit("FATAL: CR_SYS_ID is not defined.")
sys.exit("FATAL: CR_SYSID is not defined.")


def main():
Expand All @@ -203,11 +203,12 @@ def main():
DATA = os.getenv('CR_DATA')
DEBUG = True if os.getenv('DEBUG', "false").lower == "true" else False

if DEBUG:
print("Starting ServiceNow plugin for Codefresh")
print(f" ACTION: {ACTION}")
print(f" DATA: {DATA}")
print("---")
# if DEBUG:
print("Starting ServiceNow plugin for Codefresh")
print(f" ACTION: {ACTION}")
print(f" DATA: {DATA}")
print(f" DEBUG: {DEBUG}")
print("---")

if ACTION == "createcr":
createChangeRequest(user=USER,
Expand Down Expand Up @@ -245,7 +246,7 @@ def main():
user=USER,
password=PASSWORD,
baseUrl=getBaseUrl(instance=INSTANCE),
sysid=os.getenv('CR_SYSID'),
sysid=CR_SYSID,
data=DATA
)
else:
Expand Down
2 changes: 1 addition & 1 deletion incubating/service-now/step.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ spec:
commands:
- |
codefresh create annotation workflow ${{CF_BUILD_ID}} CR_NUMBER=${{CR_NUMBER}}
export createAnnotation_CF_OUTPUT_URL='[[.Arguments.SN_INSTANCE]]/nav_to.do?uri=/change_request.do?sys_id=${{CR_SYSID}}'
export createCR_CF_OUTPUT_URL='[[.Arguments.SN_INSTANCE]]/nav_to.do?uri=/change_request.do?sys_id=${{CR_SYSID}}'
# echo $createAnnotation_CF_OUTPUT_URL
# cf_export createAnnotation_CF_OUTPUT_URL
callback:
Expand Down

0 comments on commit 2208a02

Please sign in to comment.