From d8bbee54aa804dc47f80a8627d113b059ff507f8 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 18 Mar 2019 09:13:11 -0700 Subject: [PATCH] Update zuul ansible location With multi-ansible support, the location of the zuul plugins/modules has moved. Also, handle the sort_keys argument which is new in pyyaml 5.1. Set it to False to achieve the old behavior. Also use python3 by default for tox tests on this repo (note, one env still explicitly requests 2.7). Change-Id: I8e2cf1f2276bca5a912fed52062628b3b9d0d6d9 --- tools/normalize_channels_yaml.py | 1 + tools/projectconfig_yamllib.py | 5 +++-- tox.ini | 8 +++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/normalize_channels_yaml.py b/tools/normalize_channels_yaml.py index df66175624..7d317907d9 100755 --- a/tools/normalize_channels_yaml.py +++ b/tools/normalize_channels_yaml.py @@ -43,6 +43,7 @@ def main(): first = False sys.stdout.write(yaml.dump({k: chandata[k]}, default_flow_style=False, Dumper=pcy.IndentedDumper, width=80, + sort_keys=False, indent=2)) if __name__ == '__main__': diff --git a/tools/projectconfig_yamllib.py b/tools/projectconfig_yamllib.py index 5095121534..2927cd4cd1 100755 --- a/tools/projectconfig_yamllib.py +++ b/tools/projectconfig_yamllib.py @@ -62,7 +62,7 @@ class IndentedDumper(IndentedEmitter, yaml.serializer.Serializer, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, - version=None, tags=None): + version=None, tags=None, sort_keys=True): IndentedEmitter.__init__( self, stream, canonical=canonical, indent=indent, width=width, @@ -75,5 +75,6 @@ class IndentedDumper(IndentedEmitter, yaml.serializer.Serializer, version=version, tags=tags) yaml.representer.Representer.__init__( self, default_style=default_style, - default_flow_style=default_flow_style) + default_flow_style=default_flow_style, + sort_keys=sort_keys) yaml.resolver.Resolver.__init__(self) diff --git a/tox.ini b/tox.ini index a328c94065..b6ef56271d 100644 --- a/tox.ini +++ b/tox.ini @@ -5,13 +5,13 @@ skipsdist = True [testenv] passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY +basepython = python3 [testenv:linters] -basepython = python3 whitelist_externals = bash setenv = - ANSIBLE_LIBRARY= {envsitepackagesdir}/zuul/ansible/library - ANSIBLE_ACTION_PLUGINS = {envsitepackagesdir}/zuul/ansible/actiongeneral + ANSIBLE_LIBRARY= {envsitepackagesdir}/zuul/ansible/base/library + ANSIBLE_ACTION_PLUGINS = {envsitepackagesdir}/zuul/ansible/base/actiongeneral # NOTE(pabelanger): if you'd like to run tox -elinters locally, # you'll need to export ANSIBLE_ROLES_PATH pointing to the required # repos. @@ -117,13 +117,11 @@ changedir = {toxinidir}/nodepool commands = env ELEMENTS_DIR=elements dib-lint [testenv:nodepool] -basepython = python3 deps = nodepool commands = {toxinidir}/tools/nodepool-validate.sh [testenv:add-projects-to-main] -basepython = python3 whitelist_externals = git deps =