From 800782922874c1a5357f05f7456fa5ce76a8da10 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 27 Apr 2015 08:34:16 -0700 Subject: [PATCH] Enable warnings for python3 on scripts shebangs. --- v2/bin/ansible | 13 ++++++++++++- v2/bin/ansible-playbook | 32 +++++++++++++++++++++++++++++++- v2/bin/ansible-vault | 2 +- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/v2/bin/ansible b/v2/bin/ansible index 9b3ccd38be..48f956baa1 100755 --- a/v2/bin/ansible +++ b/v2/bin/ansible @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python -tt -3 -Wd # (c) 2012, Michael DeHaan # @@ -19,6 +19,17 @@ ######################################################## +__requires__ = ['ansible'] +try: + import pkg_resources +except Exception: + # Use pkg_resources to find the correct versions of libraries and set + # sys.path appropriately when there are multiversion installs. But we + # have code that better expresses the errors in the places where the code + # is actually used (the deps are optional for many code paths) so we don't + # want to fail here. + pass + import os import sys diff --git a/v2/bin/ansible-playbook b/v2/bin/ansible-playbook index d663e2e0a3..a3f20cc28e 100755 --- a/v2/bin/ansible-playbook +++ b/v2/bin/ansible-playbook @@ -1,7 +1,37 @@ -#!/usr/bin/env python +#!/usr/bin/env python -tt -3 -Wd + +# (c) 2012, Michael DeHaan +# +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . + +######################################################## from __future__ import (absolute_import, division, print_function) __metaclass__ = type +__requires__ = ['ansible'] +try: + import pkg_resources +except Exception: + # Use pkg_resources to find the correct versions of libraries and set + # sys.path appropriately when there are multiversion installs. But we + # have code that better expresses the errors in the places where the code + # is actually used (the deps are optional for many code paths) so we don't + # want to fail here. + pass + import os import stat import sys diff --git a/v2/bin/ansible-vault b/v2/bin/ansible-vault index 506402ee15..2771116b0b 100755 --- a/v2/bin/ansible-vault +++ b/v2/bin/ansible-vault @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python -tt -3 -Wd # (c) 2014, James Tanner #