Some code cleanup (removed unused variables and imports)

This commit is contained in:
Toshio Kuratomi 2015-03-16 11:58:03 -07:00 committed by Matt Clay
parent f892ca5b8f
commit d5e3abc5d5

View file

@ -359,15 +359,14 @@ HAS_DOCKER_PY = True
import sys import sys
import json import json
import re
import os import os
import shlex import shlex
from urlparse import urlparse from urlparse import urlparse
try: try:
import docker.client import docker.client
import docker.utils import docker.utils
from requests.exceptions import * from requests.exceptions import RequestException
except ImportError, e: except ImportError:
HAS_DOCKER_PY = False HAS_DOCKER_PY = False
if HAS_DOCKER_PY: if HAS_DOCKER_PY:
@ -1120,7 +1119,6 @@ class DockerManager(object):
for i in self.client.containers(all=True): for i in self.client.containers(all=True):
running_image = i['Image'] running_image = i['Image']
running_command = i['Command'].strip() running_command = i['Command'].strip()
match = False
if name: if name:
matches = name in i.get('Names', []) matches = name in i.get('Names', [])
@ -1464,7 +1462,6 @@ def main():
manager = DockerManager(module) manager = DockerManager(module)
count = int(module.params.get('count')) count = int(module.params.get('count'))
name = module.params.get('name') name = module.params.get('name')
image = module.params.get('image')
pull = module.params.get('pull') pull = module.params.get('pull')
state = module.params.get('state') state = module.params.get('state')
@ -1485,7 +1482,6 @@ def main():
manager.pull_image() manager.pull_image()
containers = ContainerSet(manager) containers = ContainerSet(manager)
failed = False
if state == 'present': if state == 'present':
present(manager, containers, count, name) present(manager, containers, count, name)