Skip to content

Commit

Permalink
Merge pull request #1245 from freephile/fixIterItems
Browse files Browse the repository at this point in the history
Python 2/3 compatibility
  • Loading branch information
darenwelsh committed Feb 6, 2020
2 parents bbcda66 + 44f2d2c commit 3838ace
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/roles/base-config-scripts/templates/config.php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $backups_environment = '{{ backups_environment }}';
{% if wiki_backup_downloaders is defined %}
# Users allowed to download specific wikis
$wiki_backup_downloaders = array();
{% for wiki, users in wiki_backup_downloaders.iteritems() %}
{% for wiki, users in wiki_backup_downloaders.items() %}
$wiki_backup_downloaders['{{ wiki }}'] = array(
{% for user in users %}
'{{ user }}',
Expand Down Expand Up @@ -105,7 +105,7 @@ $all_backup_downloaders = array(
# CUSTOM __public__ DEPLOY VARIABLES
# These should only come from public.yml
#
{% for key, value in public_deploy_vars.iteritems() %}
{% for key, value in public_deploy_vars.items() %}

{% if value is number -%}
${{ key }} = {{ value }};
Expand All @@ -117,7 +117,7 @@ $all_backup_downloaders = array(
${{ key }} = [];

{%- if value is mapping -%}
{%- for subkey, subvalue in value.iteritems() %}
{%- for subkey, subvalue in value.items() %}

{% if subvalue is number -%}
${{ key }}['{{ subkey }}'] = {{ subvalue }};
Expand Down Expand Up @@ -155,7 +155,7 @@ $all_backup_downloaders = array(
# CUSTOM __{{ env }} environment__ DEPLOY VARIABLES
# These should only come from env/{{ env }}.yml
#
{% for key, value in env_deploy_vars.iteritems() %}
{% for key, value in env_deploy_vars.items() %}

{% if value is number -%}
${{ key }} = {{ value }};
Expand All @@ -167,7 +167,7 @@ $all_backup_downloaders = array(
${{ key }} = [];

{%- if value is mapping -%}
{%- for subkey, subvalue in value.iteritems() %}
{%- for subkey, subvalue in value.items() %}

{% if subvalue is number -%}
${{ key }}['{{ subkey }}'] = {{ subvalue }};
Expand Down Expand Up @@ -204,7 +204,7 @@ $all_backup_downloaders = array(
# CUSTOM __secret__ DEPLOY VARIABLES
# These should only come from secret.yml
#
{% for key, value in secret_deploy_vars.iteritems() %}
{% for key, value in secret_deploy_vars.items() %}

{% if value is number -%}
${{ key }} = {{ value }};
Expand All @@ -216,7 +216,7 @@ $all_backup_downloaders = array(
${{ key }} = [];

{%- if value is mapping -%}
{%- for subkey, subvalue in value.iteritems() %}
{%- for subkey, subvalue in value.items() %}

{% if subvalue is number -%}
${{ key }}['{{ subkey }}'] = {{ subvalue }};
Expand Down Expand Up @@ -256,7 +256,7 @@ $all_backup_downloaders = array(
# FIXME: remove deploy_vars in lieu of secret_deploy_vars when production wikis
# are updated.
#
{% for key, value in deploy_vars.iteritems() %}
{% for key, value in deploy_vars.items() %}

{% if value is number -%}
${{ key }} = {{ value }};
Expand All @@ -268,7 +268,7 @@ $all_backup_downloaders = array(
${{ key }} = [];

{%- if value is mapping -%}
{%- for subkey, subvalue in value.iteritems() %}
{%- for subkey, subvalue in value.items() %}

{% if subvalue is number -%}
${{ key }}['{{ subkey }}'] = {{ subvalue }};
Expand Down
8 changes: 4 additions & 4 deletions src/roles/base-config-scripts/templates/config.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ m_i18n="{{ m_i18n }}"
# CUSTOM __public__ DEPLOY VARIABLES
# These should only come from public.yml
#
{% for key, value in public_deploy_vars.iteritems() %}
{% for key, value in public_deploy_vars.items() %}
{% if value is string %}
{{ key }}="{{ value }}"
{% elif value is iterable %}
Expand All @@ -80,7 +80,7 @@ m_i18n="{{ m_i18n }}"
# CUSTOM __{{ env }} environment__ DEPLOY VARIABLES
# These should only come from env/{{ env }}.yml
#
{% for key, value in env_deploy_vars.iteritems() %}
{% for key, value in env_deploy_vars.items() %}
{% if value is string %}
{{ key }}="{{ value }}"
{% elif value is iterable %}
Expand All @@ -97,7 +97,7 @@ m_i18n="{{ m_i18n }}"
# CUSTOM __secret__ DEPLOY VARIABLES
# These should only come from secret.yml
#
{% for key, value in secret_deploy_vars.iteritems() %}
{% for key, value in secret_deploy_vars.items() %}
{% if value is string %}
{{ key }}="{{ value }}"
{% elif value is iterable %}
Expand All @@ -116,7 +116,7 @@ m_i18n="{{ m_i18n }}"
# FIXME: remove deploy_vars in lieu of secret_deploy_vars when production wikis
# are updated.
#
{% for key, value in deploy_vars.iteritems() %}
{% for key, value in deploy_vars.items() %}
{% if value is string %}
{{ key }}="{{ value }}"
{% elif value is iterable %}
Expand Down
2 changes: 1 addition & 1 deletion src/roles/saml/templates/samlLocalSettings.php.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if ( isset( $_SERVER['HTTP_X_SKIP_SAML'] ) ) {
// FIXME #822: The indenting below will be heinous when Ansible does its templating
{% if allow_skip_saml_users is defined -%}
$wgMezaAllowSkipSamlUsers = array();
{% for user, ipaddrs in allow_skip_saml_users.iteritems() -%}
{% for user, ipaddrs in allow_skip_saml_users.items() -%}
$wgMezaAllowSkipSamlUsers['{{ user }}'] = array(
{%- for ipaddr in ipaddrs -%}'{{ ipaddr }}',{%- endfor -%}
);
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/meza.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ def playbook_cmd ( playbook, env=False, more_extra_vars=False ):
extra_vars = {}

if more_extra_vars:
for varname, value in more_extra_vars.iteritems():
for varname, value in more_extra_vars.items():
extra_vars[varname] = value

if len(extra_vars) > 0:
Expand Down

0 comments on commit 3838ace

Please sign in to comment.