Whitespace in SSLCertificate param causes jq error

Bug #1317446 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Invalid
Medium
Stuart McLaren

Bug Description

In devtest_overcloud.sh

The following error is produced when SSLBASE is set:

++ jq '.parameters.SSLCertificate="-----BEGIN' CERTIFICATE----- MIIC3DCCAkWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBxDEeMBwGA1UEChMVT3Bl bnN0YWNrIEZha2UgQ0EgT3JnMRowGAYDVQQLExFPcGVuc3RhY2sgRmFrZSBDQTEq MCgGCSqGSIb3DQEJARYbYWRtaW5Ab3BlbnN0YWNrLmV4YW1wbGUuY29tMREwDwYD VQQHEwhTdGF0ZSBBWjELMAkGA1UECBMCQVoxCzAJBgNVBAYTAkFVMS0wKwYDVQQD EyRPcGVuc3RhY2sgRmFrZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTQwNTA3 MTY1NzU4WhcNMTcwMTMxMTY1NzU4WjCBojEZMBcGA1UEChMQVHJpcGxlTyBGYWtl IE9yZzEaMBgGA1UECxMRVHJpcGxlTyBGYWtlIFVuaXQxKDAmBgkqhkiG9w0BCQEW GWFkbWluQHRyaXBsZW8uZXhhbXBsZS5jb20xDzANBgNVBAcTBlN0YXRlMTELMAkG A1UECBMCQVoxCzAJBgNVBAYTAlVTMRQwEgYDVQQDEwsxOTIuMC4yLjI1NDCBnzAN BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApP6GRp+PQPoagY8gxmEexBjZ3xKjgYTZ kniaob46Le63tMpzEdJZYYeaCwz9JzyIRfIfzOY3dVmHMB+ty9wOCc0qNXdhC5+Z s0uBSr00VIOzjM4iv5mkmQDNZB2Wkm0NHhN0CvMsQz1b0vW/d5ww4GFLQQjkIaRe isSiFAhe1n0CAwEAATANBgkqhkiG9w0BAQUFAAOBgQAGk41AE9TQ+q9EQJYF5xN1 WSw+K0Ei7aLLiqA78XYlSTb5CgaujtsT0Pj9Cd6X3w21f0Dq4zqPi/8eA+DTB43F LB7JA8inYZE7eYfHMoLtre9KvAnEzzvX6y6UgPa7crrdjfq42to/eMlrCgyuSA5w LL2Y7F1gCftxyG0JCg6ifQ== -----END 'CERTIFICATE-----"'
jq: Unknown option -----END

This was most likely caused by this commit: eafaf0f9993a350f8a2699b55a1fcf8dda71ebf5

The effect of a space in a param can be seen with:

$ export XXX="hi there"

$ jq .parameters.SSLCertificate=\"$XXX\" <<< '{ "parameters" :{}}'
error: syntax error, unexpected $end, expecting QQSTRING_TEXT or QQSTRING_INTERP_START or QQSTRING_END
.parameters.SSLCertificate="hi
                            ^^
1 compile error

Adding quotes to preserve the whitespace fixes the issue as follows:

$ jq .parameters.SSLCertificate=\""$XXX"\" <<< '{ "parameters" :{}}'
{
  "parameters": {
    "SSLCertificate": "hi there"
  }
}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/92801

Changed in tripleo:
assignee: nobody → Stuart McLaren (stuart-mclaren)
status: New → In Progress
Revision history for this message
Jiří Stránský (jistr) wrote :

Stuart, i see that the linked patch is abandoned and mentions this has been fixed elsewhere. Can we close this bug?

Changed in tripleo:
importance: Undecided → Medium
Revision history for this message
Brent Eagles (beagles) wrote :

Given jistr's findings and the fact the question has gone answered, I'm closing this bug. Please feel free to refile or request for it to be reopened if it is still valid.

Changed in tripleo:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.