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
This commit is contained in:
rboyapat 2018-09-30 08:10:12 -04:00 committed by k8s-ci-robot
parent 71f6c018ce
commit d9f495d391
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{% endif %} {% endif %}
{% set inventory_node_labels = [] %} {% set inventory_node_labels = [] %}
{% if node_labels is defined %} {% 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)) %} {% set dummy = inventory_node_labels.append('%s=%s'|format(labelname, labelvalue)) %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View file

@ -107,7 +107,7 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{% endif %} {% endif %}
{% set inventory_node_labels = [] %} {% set inventory_node_labels = [] %}
{% if node_labels is defined %} {% 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)) %} {% set dummy = inventory_node_labels.append('%s=%s'|format(labelname, labelvalue)) %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}