Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions hostProviders/ibmcloudgen2/scripts/nextgen_request_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,15 @@ def main():
logging.error("Fail to create any VSI")
outJson = RequestMachinesOutput()
if error:
outJson.message = error
logging.critical(outJson)
print(outJson)
# For ebrokerd to disable template, must exit with non-zero code
# Print error message to stderr with "Error Code:" format
outJson.message = error # Contains "Error Code: " format
logging.critical(outJson)
print(outJson)
sys.exit(1)
else:
logging.critical(outJson)
print(outJson)
else:
createdInstanceList = instanceList

Expand Down
5 changes: 3 additions & 2 deletions hostProviders/ibmcloudgen2/scripts/vpc_vm_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import logging
import random
import traceback
import json

from nextgen_rc_config import NextGenTemplate, NextGenConfig
from nextgen_utils import RCInstance
Expand Down Expand Up @@ -339,11 +340,11 @@ def create_multi_instances(args):
try:
if hasattr(e, 'response') and hasattr(e.response, 'text'):
error_json = json.loads(e.response.text)
ogging.error("Parsed error JSON: %s", json.dumps(error_json, indent=2))
logging.error("Parsed error JSON: %s", json.dumps(error_json, indent=2))
except:
pass

newInstance['error'] = f"{message} (code: {code})"
newInstance['error'] = f"{message}. Error Code: {code}"
return newInstance

return newInstance
Expand Down