From d9f495d391febce1e848621b80d4fdbf20daaca7 Mon Sep 17 00:00:00 2001 From: rboyapat Date: Sun, 30 Sep 2018 08:10:12 -0400 Subject: [PATCH] Fix the dic iteration method in the kubelet template (#3415) * Fix the jinja expression for openstack_tenant_id OS_PROJECT_ID is obsolete in keystone v3 and jinja expression doesn't set openstack_tenant_id as expected because of undefined env var. Fixed the expression. * Fix the dic iteration method in the kubelet template Kubelet template rendering errors when additional Node lables are added and using Python3. Update the method to be compatible to both python2/3 Node lables doesn't work --- roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 | 2 +- roles/kubernetes/node/templates/kubelet.standard.env.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 b/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 index a1282a03c..8dc19d2cf 100644 --- a/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 +++ b/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2 @@ -88,7 +88,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}" {% endif %} {% set inventory_node_labels = [] %} {% if node_labels is defined %} -{% for labelname, labelvalue in node_labels.iteritems() %} +{% for labelname, labelvalue in node_labels.items() %} {% set dummy = inventory_node_labels.append('%s=%s'|format(labelname, labelvalue)) %} {% endfor %} {% endif %} diff --git a/roles/kubernetes/node/templates/kubelet.standard.env.j2 b/roles/kubernetes/node/templates/kubelet.standard.env.j2 index a01e2f8f8..d978b4ad8 100644 --- a/roles/kubernetes/node/templates/kubelet.standard.env.j2 +++ b/roles/kubernetes/node/templates/kubelet.standard.env.j2 @@ -107,7 +107,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}" {% endif %} {% set inventory_node_labels = [] %} {% if node_labels is defined %} -{% for labelname, labelvalue in node_labels.iteritems() %} +{% for labelname, labelvalue in node_labels.items() %} {% set dummy = inventory_node_labels.append('%s=%s'|format(labelname, labelvalue)) %} {% endfor %} {% endif %}