Remove unused imports

This commit is contained in:
Przemyslaw Kaminski 2015-09-10 08:11:44 +02:00
parent 8a72fc5a22
commit caaa51d2cd
16 changed files with 8 additions and 40 deletions

View File

@ -16,6 +16,7 @@ import os
from setuptools import find_packages
from setuptools import setup
def find_requires():
prj_root = os.path.dirname(os.path.realpath(__file__))
requirements = []

View File

@ -7,8 +7,6 @@ class DryRunExecutor(object):
from fabric.contrib import project as fabric_project
import mock
from solar.core.handlers import puppet
self.executed = []
self.mapping = mapping or {}

View File

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from fabric import api as fabric_api
from fabric.state import env
import os
@ -11,6 +10,7 @@ from solar import errors
# otherwise fabric will sys.exit(1) in case of errors
env.warn_only = True
# if we would have something like solard that would render this then
# we would not need to render it there
# for now we redender it locally, sync to remote, run ansible on remote host as local
@ -40,7 +40,6 @@ class AnsibleTemplate(TempFileHandler):
# if out.failed:
# raise errors.SolarError(out)
def _create_inventory(self, r):
directory = self.dirs[r.name]
inventory_path = os.path.join(directory, 'inventory')
@ -70,4 +69,3 @@ class AnsibleTemplate(TempFileHandler):
args = super(AnsibleTemplate, self)._make_args(resource)
args['host'] = 'localhost'
return args

View File

@ -1,9 +1,4 @@
# -*- coding: utf-8 -*-
from contextlib import nested
from functools import partial
from fabric import api as fabric_api
from fabric.contrib import project as fabric_project
import os
from solar.core.log import log

View File

@ -1,13 +1,8 @@
# -*- coding: utf-8 -*-
import os
from copy import deepcopy
import solar
from solar.core import actions
from solar.core import observer
from solar.core import signals
from solar.core import validation
from solar.interfaces.db import get_db

View File

@ -1,7 +1,3 @@
import os
from functools import partial
from contextlib import nested
from fabric import api as fabric_api
from solar.core.log import log

View File

@ -1,5 +1,4 @@
import os
from functools import partial
from contextlib import nested
from fabric import api as fabric_api

View File

@ -6,7 +6,7 @@ import networkx as nx
from solar.core.log import log
from solar.interfaces.db import get_db
from solar.events.controls import Dep, React, StateChange
from solar.events.controls import Dep, React
db = get_db()

View File

@ -17,8 +17,6 @@ trigger action even if no changes noticed on dependent resource.
- parent:update -> ok -> dependent:update
"""
import re
class Event(object):

View File

@ -3,9 +3,6 @@ import json
import redis
import fakeredis
from solar import utils
from solar import errors
class RedisDB(object):
COLLECTIONS = Enum(
@ -18,7 +15,6 @@ class RedisDB(object):
}
REDIS_CLIENT = redis.StrictRedis
def __init__(self):
self._r = self.REDIS_CLIENT(**self.DB)
self.entities = {}

View File

@ -2,7 +2,6 @@
import networkx as nx
from .traversal import VISITED, states
from solar import errors
def get_dfs_postorder_subgraph(dg, nodes):

View File

@ -38,7 +38,7 @@ def type_based_rule(dg, inprogress, item):
type_limit: 2
"""
_type = dg.node[item].get('resource_type')
if not 'type_limit' in dg.node[item]: return True
if 'type_limit' not in dg.node[item]: return True
if not _type: return True
type_count = 0

View File

@ -1,6 +1,5 @@
from functools import partial, wraps
from itertools import islice
from functools import partial
import subprocess
import time
@ -8,7 +7,6 @@ from celery.app import task
import redis
from solar.orchestration import graph
from solar.orchestration import filters
from solar.core import actions
from solar.core import resource
from solar.system_log.tasks import commit_logitem, error_logitem
@ -24,6 +22,7 @@ r = redis.StrictRedis(host='10.0.0.2', port=6379, db=1)
__all__ = ['solar_resource', 'cmd', 'sleep',
'error', 'fault_tolerance', 'schedule_start', 'schedule_next']
# NOTE(dshulyak) i am not using celery.signals because it is not possible
# to extract task_id from *task_success* signal
class ReportTask(task.Task):

View File

@ -1,6 +1,4 @@
from dictdiffer import diff, patch, revert
from dictdiffer import diff
import networkx as nx
from solar.core.log import log
@ -8,7 +6,6 @@ from solar.core import signals
from solar.core import resource
from solar import utils
from solar.interfaces.db import get_db
from solar.core import actions
from solar.system_log import data
from solar.orchestration import graph
from solar.events import api as evapi

View File

@ -1,7 +1,4 @@
import os
import collections
from collections import deque
from functools import partial
from solar import utils

View File

@ -39,7 +39,7 @@ def yaml_dump_to(data, file_path):
def find_by_mask(mask):
for file_path in glob.glob(mask):
for file_path in glob.glob(mask):
yield os.path.abspath(file_path)