Remove unused imports
This commit is contained in:
parent
8a72fc5a22
commit
caaa51d2cd
@ -16,6 +16,7 @@ import os
|
|||||||
from setuptools import find_packages
|
from setuptools import find_packages
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
def find_requires():
|
def find_requires():
|
||||||
prj_root = os.path.dirname(os.path.realpath(__file__))
|
prj_root = os.path.dirname(os.path.realpath(__file__))
|
||||||
requirements = []
|
requirements = []
|
||||||
|
@ -7,8 +7,6 @@ class DryRunExecutor(object):
|
|||||||
from fabric.contrib import project as fabric_project
|
from fabric.contrib import project as fabric_project
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from solar.core.handlers import puppet
|
|
||||||
|
|
||||||
self.executed = []
|
self.executed = []
|
||||||
|
|
||||||
self.mapping = mapping or {}
|
self.mapping = mapping or {}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from fabric import api as fabric_api
|
|
||||||
from fabric.state import env
|
from fabric.state import env
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -11,6 +10,7 @@ from solar import errors
|
|||||||
# otherwise fabric will sys.exit(1) in case of errors
|
# otherwise fabric will sys.exit(1) in case of errors
|
||||||
env.warn_only = True
|
env.warn_only = True
|
||||||
|
|
||||||
|
|
||||||
# if we would have something like solard that would render this then
|
# if we would have something like solard that would render this then
|
||||||
# we would not need to render it there
|
# we would not need to render it there
|
||||||
# for now we redender it locally, sync to remote, run ansible on remote host as local
|
# 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:
|
# if out.failed:
|
||||||
# raise errors.SolarError(out)
|
# raise errors.SolarError(out)
|
||||||
|
|
||||||
|
|
||||||
def _create_inventory(self, r):
|
def _create_inventory(self, r):
|
||||||
directory = self.dirs[r.name]
|
directory = self.dirs[r.name]
|
||||||
inventory_path = os.path.join(directory, 'inventory')
|
inventory_path = os.path.join(directory, 'inventory')
|
||||||
@ -70,4 +69,3 @@ class AnsibleTemplate(TempFileHandler):
|
|||||||
args = super(AnsibleTemplate, self)._make_args(resource)
|
args = super(AnsibleTemplate, self)._make_args(resource)
|
||||||
args['host'] = 'localhost'
|
args['host'] = 'localhost'
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
import os
|
||||||
|
|
||||||
from solar.core.log import log
|
from solar.core.log import log
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
import solar
|
|
||||||
|
|
||||||
from solar.core import actions
|
from solar.core import actions
|
||||||
from solar.core import observer
|
from solar.core import observer
|
||||||
from solar.core import signals
|
|
||||||
from solar.core import validation
|
from solar.core import validation
|
||||||
|
|
||||||
from solar.interfaces.db import get_db
|
from solar.interfaces.db import get_db
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
import os
|
|
||||||
from functools import partial
|
|
||||||
from contextlib import nested
|
|
||||||
|
|
||||||
from fabric import api as fabric_api
|
from fabric import api as fabric_api
|
||||||
|
|
||||||
from solar.core.log import log
|
from solar.core.log import log
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
from functools import partial
|
|
||||||
from contextlib import nested
|
from contextlib import nested
|
||||||
|
|
||||||
from fabric import api as fabric_api
|
from fabric import api as fabric_api
|
||||||
|
@ -6,7 +6,7 @@ import networkx as nx
|
|||||||
|
|
||||||
from solar.core.log import log
|
from solar.core.log import log
|
||||||
from solar.interfaces.db import get_db
|
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()
|
db = get_db()
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@ trigger action even if no changes noticed on dependent resource.
|
|||||||
- parent:update -> ok -> dependent:update
|
- parent:update -> ok -> dependent:update
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
class Event(object):
|
class Event(object):
|
||||||
|
|
||||||
|
@ -3,9 +3,6 @@ import json
|
|||||||
import redis
|
import redis
|
||||||
import fakeredis
|
import fakeredis
|
||||||
|
|
||||||
from solar import utils
|
|
||||||
from solar import errors
|
|
||||||
|
|
||||||
|
|
||||||
class RedisDB(object):
|
class RedisDB(object):
|
||||||
COLLECTIONS = Enum(
|
COLLECTIONS = Enum(
|
||||||
@ -18,7 +15,6 @@ class RedisDB(object):
|
|||||||
}
|
}
|
||||||
REDIS_CLIENT = redis.StrictRedis
|
REDIS_CLIENT = redis.StrictRedis
|
||||||
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._r = self.REDIS_CLIENT(**self.DB)
|
self._r = self.REDIS_CLIENT(**self.DB)
|
||||||
self.entities = {}
|
self.entities = {}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import networkx as nx
|
import networkx as nx
|
||||||
|
|
||||||
from .traversal import VISITED, states
|
from .traversal import VISITED, states
|
||||||
from solar import errors
|
|
||||||
|
|
||||||
|
|
||||||
def get_dfs_postorder_subgraph(dg, nodes):
|
def get_dfs_postorder_subgraph(dg, nodes):
|
||||||
|
@ -38,7 +38,7 @@ def type_based_rule(dg, inprogress, item):
|
|||||||
type_limit: 2
|
type_limit: 2
|
||||||
"""
|
"""
|
||||||
_type = dg.node[item].get('resource_type')
|
_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
|
if not _type: return True
|
||||||
|
|
||||||
type_count = 0
|
type_count = 0
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
from functools import partial, wraps
|
from functools import partial
|
||||||
from itertools import islice
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -8,7 +7,6 @@ from celery.app import task
|
|||||||
import redis
|
import redis
|
||||||
|
|
||||||
from solar.orchestration import graph
|
from solar.orchestration import graph
|
||||||
from solar.orchestration import filters
|
|
||||||
from solar.core import actions
|
from solar.core import actions
|
||||||
from solar.core import resource
|
from solar.core import resource
|
||||||
from solar.system_log.tasks import commit_logitem, error_logitem
|
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',
|
__all__ = ['solar_resource', 'cmd', 'sleep',
|
||||||
'error', 'fault_tolerance', 'schedule_start', 'schedule_next']
|
'error', 'fault_tolerance', 'schedule_start', 'schedule_next']
|
||||||
|
|
||||||
|
|
||||||
# NOTE(dshulyak) i am not using celery.signals because it is not possible
|
# NOTE(dshulyak) i am not using celery.signals because it is not possible
|
||||||
# to extract task_id from *task_success* signal
|
# to extract task_id from *task_success* signal
|
||||||
class ReportTask(task.Task):
|
class ReportTask(task.Task):
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
|
from dictdiffer import diff
|
||||||
|
|
||||||
from dictdiffer import diff, patch, revert
|
|
||||||
import networkx as nx
|
import networkx as nx
|
||||||
|
|
||||||
from solar.core.log import log
|
from solar.core.log import log
|
||||||
@ -8,7 +6,6 @@ from solar.core import signals
|
|||||||
from solar.core import resource
|
from solar.core import resource
|
||||||
from solar import utils
|
from solar import utils
|
||||||
from solar.interfaces.db import get_db
|
from solar.interfaces.db import get_db
|
||||||
from solar.core import actions
|
|
||||||
from solar.system_log import data
|
from solar.system_log import data
|
||||||
from solar.orchestration import graph
|
from solar.orchestration import graph
|
||||||
from solar.events import api as evapi
|
from solar.events import api as evapi
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
|
|
||||||
import os
|
|
||||||
import collections
|
import collections
|
||||||
from collections import deque
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from solar import utils
|
from solar import utils
|
||||||
|
@ -39,7 +39,7 @@ def yaml_dump_to(data, file_path):
|
|||||||
|
|
||||||
|
|
||||||
def find_by_mask(mask):
|
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)
|
yield os.path.abspath(file_path)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user