From 08272dc25dc99b5d2c509a9f09f581648446512b Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Thu, 9 Aug 2012 21:25:13 -0700 Subject: [PATCH] Remove unused imports. --- lib/ansible/inventory/host.py | 2 -- lib/ansible/inventory/ini.py | 8 +------- lib/ansible/inventory/script.py | 3 --- lib/ansible/runner/__init__.py | 7 +------ lib/ansible/runner/connection/paramiko_ssh.py | 5 ----- lib/ansible/utils.py | 1 - test/TestInventory.py | 3 --- test/TestPlayBook.py | 5 ----- test/TestRunner.py | 4 ---- test/TestUtils.py | 1 - 10 files changed, 2 insertions(+), 37 deletions(-) diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index 0611c1239c5..b73d1c6588c 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -15,7 +15,6 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . -from ansible import errors import ansible.constants as C class Host(object): @@ -63,4 +62,3 @@ class Host(object): groups = self.get_groups() results['group_names'] = sorted([ g.name for g in groups if g.name != 'all']) return results - diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index 42b50553ef0..8251d08697d 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -17,17 +17,13 @@ ############################################# -import fnmatch -import os -import subprocess - import ansible.constants as C from ansible.inventory.host import Host from ansible.inventory.group import Group from ansible.inventory.expand_hosts import detect_range from ansible.inventory.expand_hosts import expand_hostname_range from ansible import errors -from ansible import utils + class InventoryParser(object): """ @@ -170,5 +166,3 @@ class InventoryParser(object): else: (k,v) = line.split("=",1) group.set_variable(k,v) - - diff --git a/lib/ansible/inventory/script.py b/lib/ansible/inventory/script.py index 6d87e6b5588..524ee83319f 100644 --- a/lib/ansible/inventory/script.py +++ b/lib/ansible/inventory/script.py @@ -17,12 +17,10 @@ ############################################# -import os import subprocess import ansible.constants as C from ansible.inventory.host import Host from ansible.inventory.group import Group -from ansible import errors from ansible import utils class InventoryScript(object): @@ -53,4 +51,3 @@ class InventoryScript(object): all.add_host(host) all.add_child_group(group) return groups - diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index ec71af5fe44..c80e07399d6 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -24,12 +24,8 @@ import random import traceback import tempfile import time -import base64 -import getpass -import codecs import collections import socket -import re import ansible.constants as C import ansible.inventory @@ -38,7 +34,7 @@ from ansible import errors from ansible import module_common import poller import connection -from ansible.callbacks import DefaultRunnerCallbacks, vv, vvv +from ansible.callbacks import DefaultRunnerCallbacks, vv HAS_ATFORK=True try: @@ -800,4 +796,3 @@ class Runner(object): self.background = time_limit results = self.run() return results, poller.AsyncPoller(results, self) - diff --git a/lib/ansible/runner/connection/paramiko_ssh.py b/lib/ansible/runner/connection/paramiko_ssh.py index 79d91ec5a35..04b8e8c2da2 100644 --- a/lib/ansible/runner/connection/paramiko_ssh.py +++ b/lib/ansible/runner/connection/paramiko_ssh.py @@ -16,15 +16,10 @@ # along with Ansible. If not, see . import warnings -import traceback import os -import re -import shutil -import subprocess import pipes import socket import random -from ansible import utils from ansible.callbacks import vvv from ansible import errors diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index b248ce8182e..9582ab9f823 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -25,7 +25,6 @@ import yaml import optparse import operator from ansible import errors -from ansible import color from ansible import __version__ import ansible.constants as C import time diff --git a/test/TestInventory.py b/test/TestInventory.py index 680ad72bd26..8ce9e979f90 100644 --- a/test/TestInventory.py +++ b/test/TestInventory.py @@ -2,8 +2,6 @@ import os import unittest from ansible.inventory import Inventory -from ansible.runner import Runner -# from nose.plugins.skip import SkipTest class TestInventory(unittest.TestCase): @@ -236,4 +234,3 @@ class TestInventory(unittest.TestCase): 'group_names': ['norse'], 'inventory_hostname': 'thor', 'inventory_hostname_short': 'thor'} - diff --git a/test/TestPlayBook.py b/test/TestPlayBook.py index d5b828f2f43..ebd8bd7aef9 100644 --- a/test/TestPlayBook.py +++ b/test/TestPlayBook.py @@ -10,11 +10,6 @@ import ansible.utils as utils import ansible.callbacks as ans_callbacks import os import shutil -import time -try: - import json -except: - import simplejson as json EVENTS = [] diff --git a/test/TestRunner.py b/test/TestRunner.py index a29c36009e0..37cb9ded7cc 100644 --- a/test/TestRunner.py +++ b/test/TestRunner.py @@ -10,10 +10,6 @@ import os import shutil import time import tempfile -try: - import json -except: - import simplejson as json from nose.plugins.skip import SkipTest diff --git a/test/TestUtils.py b/test/TestUtils.py index 6eab8373f34..00eee68fcfc 100644 --- a/test/TestUtils.py +++ b/test/TestUtils.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -import os import unittest import ansible.utils