diff --git a/promenade/control/base.py b/promenade/control/base.py index 19dee419..f25e5dcf 100644 --- a/promenade/control/base.py +++ b/promenade/control/base.py @@ -53,9 +53,11 @@ class BaseResource(object): raw_body = req.stream.read(req.content_length or 0) if raw_body is not None: has_input = True - self.info(req.context, 'Input message body: %s' % raw_body) + LOG.info('Input message body: %s \nContext: %s' % + (raw_body, req.context)) else: - self.info(req.context, 'No message body specified') + LOG.info( + 'No message body specified. \nContext: %s' % req.context) if has_input: # read the json and validate if necessary try: @@ -66,8 +68,8 @@ class BaseResource(object): validate(json_body, json.loads(validate_json_schema)) return json_body except json.JSONDecodeError as jex: - self.error(req.context, - "Invalid JSON in request: \n%s" % raw_body) + LOG.error('Invalid JSON in request: \n%s \nContext: %s' % + (raw_body, req.context)) raise exc.InvalidFormatError( title='JSON could not be decoded', description='%s: Invalid JSON in body: %s' % (req.path, diff --git a/tools/g2/stages/join-nodes.sh b/tools/g2/stages/join-nodes.sh index eeba69f7..67686463 100755 --- a/tools/g2/stages/join-nodes.sh +++ b/tools/g2/stages/join-nodes.sh @@ -73,15 +73,14 @@ render_curl_url() { echo "${BASE_URL}?${DESIGN_REF}&${HOST_PARAMS}${LABEL_PARAMS}" } -render_validate_url() { - BASE_URL="${BASE_PROM_URL}/api/v1.0/validatedesign" +render_validate_body() { if [[ ${USE_DECKHAND} == 1 ]]; then - HREF="href=deckhand%2Bhttp://deckhand-int.ucp.svc.cluster.local:9000/api/v1.0/revisions/${DECKHAND_REVISION}/rendered-documents" + JSON="{\"rel\":\"design\",\"href\":\"deckhand+http://deckhand-int.ucp.svc.cluster.local:9000/api/v1.0/revisions/${DECKHAND_REVISION}/rendered-documents\",\"type\":\"application/x-yaml\"}" else - HREF="href=${NGINX_URL}/promenade.yaml" + JSON="{\"rel\":\"design\",\"href\":\"${NGINX_URL}/promenade.yaml\",\"type\":\"application/x-yaml\"}" fi - echo "${BASE_URL}?${HREF}" + echo ${JSON} } mkdir -p "${SCRIPT_DIR}" @@ -115,7 +114,7 @@ for NAME in "${NODES[@]}"; do done log "Validating documents" - ssh_cmd "${VIA}" curl -v "${CURL_ARGS[@]}" -X POST "$(render_validate_url)" + ssh_cmd "${VIA}" curl -v "${CURL_ARGS[@]}" -X POST -H "Content-Type: application/json" -d $(render_validate_body) "${BASE_PROM_URL}/api/v1.0/validatedesign" JOIN_CURL_URL="$(render_curl_url "${NAME}" "${LABELS[@]}")" log "Fetching join script via: ${JOIN_CURL_URL}"