Pass OpenStack-API-Version header in make-cert scripts
Otherwise, the magnum certificates API will return a 406 Not Acceptable error. Change-Id: I0d59bf71b62bdd4204cd32d26ef3f2fc30f8f180 Closes-Bug: #1659423
This commit is contained in:
parent
48f3638055
commit
fbfdbec60d
|
@ -70,6 +70,7 @@ USER_TOKEN=`curl -k -s -i -X POST -H "$content_type" -d "$auth_json" $url \
|
|||
# Get CA certificate for this cluster
|
||||
curl -k -X GET \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
$MAGNUM_URL/certificates/$CLUSTER_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > $CA_CERT
|
||||
|
||||
# Create config for client's csr
|
||||
|
@ -103,6 +104,7 @@ openssl req -new -days 1000 \
|
|||
csr_req=$(python -c "import json; fp = open('${CLIENT_CSR}'); print json.dumps({'cluster_uuid': '$CLUSTER_UUID', 'csr': fp.read()}); fp.close()")
|
||||
curl -k -X POST \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$csr_req" \
|
||||
$MAGNUM_URL/certificates | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CLIENT_CERT}
|
||||
|
|
|
@ -92,6 +92,7 @@ USER_TOKEN=`curl -k -s -i -X POST -H "$content_type" -d "$auth_json" $url \
|
|||
# Get CA certificate for this cluster
|
||||
curl -k -X GET \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
$MAGNUM_URL/certificates/$CLUSTER_UUID | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${CA_CERT}
|
||||
|
||||
# Create config for server's csr
|
||||
|
@ -120,6 +121,7 @@ openssl req -new -days 1000 \
|
|||
csr_req=$(python -c "import json; fp = open('${SERVER_CSR}'); print json.dumps({'cluster_uuid': '$CLUSTER_UUID', 'csr': fp.read()}); fp.close()")
|
||||
curl -k -X POST \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$csr_req" \
|
||||
$MAGNUM_URL/certificates | python -c 'import sys, json; print json.load(sys.stdin)["pem"]' > ${SERVER_CERT}
|
||||
|
|
|
@ -84,7 +84,8 @@ def _build_subject_alt_names(config):
|
|||
def write_ca_cert(config):
|
||||
cluster_cert_url = '%s/certificates/%s' % (config['MAGNUM_URL'],
|
||||
config['CLUSTER_UUID'])
|
||||
headers = {'X-Auth-Token': config['USER_TOKEN']}
|
||||
headers = {'X-Auth-Token': config['USER_TOKEN'],
|
||||
'OpenStack-API-Version': 'container-infra latest'}
|
||||
ca_cert_resp = requests.get(cluster_cert_url,
|
||||
headers=headers)
|
||||
|
||||
|
@ -124,7 +125,8 @@ def write_server_cert(config, csr_req):
|
|||
cert_url = '%s/certificates' % config['MAGNUM_URL']
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Auth-Token': config['USER_TOKEN']
|
||||
'X-Auth-Token': config['USER_TOKEN'],
|
||||
'OpenStack-API-Version': 'container-infra latest'
|
||||
}
|
||||
csr_resp = requests.post(cert_url,
|
||||
data=json.dumps(csr_req),
|
||||
|
|
|
@ -85,6 +85,7 @@ write_files:
|
|||
|
||||
ca_cert_json=$(curl -k -X GET \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
$MAGNUM_URL/certificates/$CLUSTER_UUID)
|
||||
parse_json_response "${ca_cert_json}" > ${CA_CERT}
|
||||
|
||||
|
@ -121,6 +122,7 @@ write_files:
|
|||
# Send csr to Magnum to have it signed
|
||||
client_cert_json=$(curl -k -X POST \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$csr_req" \
|
||||
$MAGNUM_URL/certificates)
|
||||
|
|
|
@ -109,6 +109,7 @@ write_files:
|
|||
# Get CA certificate for this cluster
|
||||
ca_cert_json=$(curl -k -X GET \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
$MAGNUM_URL/certificates/$CLUSTER_UUID)
|
||||
parse_json_response "${ca_cert_json}" > ${CA_CERT}
|
||||
|
||||
|
@ -140,6 +141,7 @@ write_files:
|
|||
# Send csr to Magnum to have it signed
|
||||
server_cert_json=$(curl -k -X POST \
|
||||
-H "X-Auth-Token: $USER_TOKEN" \
|
||||
-H "OpenStack-API-Version: container-infra latest" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$csr_req" \
|
||||
$MAGNUM_URL/certificates)
|
||||
|
|
Loading…
Reference in New Issue