graphite-project / carbon

Indentation is not a multiple of four FLK-E111
Style
Major
262 occurrences in this check
indentation is not a multiple of 4
 39try:
 40  import carbon.protobuf  # NOQA
 41except ImportError:
 42  pass 43
 44
 45class CarbonRootService(MultiService):
indentation is not a multiple of 4
 45class CarbonRootService(MultiService):
 46  """Root Service that properly configures twistd logging"""
 47
 48  def setServiceParent(self, parent): 49    MultiService.setServiceParent(self, parent)
 50    if isinstance(parent, Componentized):
 51      parent.setComponent(ILogObserver, carbonLogObserver)
indentation is not a multiple of 4
 48  def setServiceParent(self, parent):
 49    MultiService.setServiceParent(self, parent)
 50    if isinstance(parent, Componentized):
 51      parent.setComponent(ILogObserver, carbonLogObserver) 52
 53
 54def createBaseService(config, settings):
indentation is not a multiple of 4
 82
 83
 84def setupPipeline(pipeline, root_service, settings):
 85  state.pipeline_processors = [] 86
 87  for processor in pipeline:
 88    args = []
indentation is not a multiple of 4
 84def setupPipeline(pipeline, root_service, settings):
 85  state.pipeline_processors = []
 86
 87  for processor in pipeline: 88    args = []
 89    if ':' in processor:
 90      processor, arglist = processor.split(':', 1)
indentation is not a multiple of 4
 87  for processor in pipeline:
 88    args = []
 89    if ':' in processor:
 90      processor, arglist = processor.split(':', 1) 91      args = arglist.split(',')
 92
 93    if processor == 'aggregate':
indentation is not a multiple of 4
 88    args = []
 89    if ':' in processor:
 90      processor, arglist = processor.split(':', 1)
 91      args = arglist.split(',') 92
 93    if processor == 'aggregate':
 94      setupAggregatorProcessor(root_service, settings)
indentation is not a multiple of 4
 91      args = arglist.split(',')
 92
 93    if processor == 'aggregate':
 94      setupAggregatorProcessor(root_service, settings) 95    elif processor == 'rewrite':
 96      setupRewriterProcessor(root_service, settings)
 97    elif processor == 'relay':
indentation is not a multiple of 4
 93    if processor == 'aggregate':
 94      setupAggregatorProcessor(root_service, settings)
 95    elif processor == 'rewrite':
 96      setupRewriterProcessor(root_service, settings) 97    elif processor == 'relay':
 98      setupRelayProcessor(root_service, settings)
 99    elif processor == 'write':
indentation is not a multiple of 4
 95    elif processor == 'rewrite':
 96      setupRewriterProcessor(root_service, settings)
 97    elif processor == 'relay':
 98      setupRelayProcessor(root_service, settings) 99    elif processor == 'write':
100      setupWriterProcessor(root_service, settings)
101    else:
indentation is not a multiple of 4
 35try:
 36  import carbon.amqp_listener
 37except ImportError:
 38  pass 39try:
 40  import carbon.protobuf  # NOQA
 41except ImportError:
indentation is not a multiple of 4
 33except ImportError:
 34  pass
 35try:
 36  import carbon.amqp_listener 37except ImportError:
 38  pass
 39try:
indentation is not a multiple of 4
 31try:
 32  import carbon.manhole
 33except ImportError:
 34  pass 35try:
 36  import carbon.amqp_listener
 37except ImportError:
indentation is not a multiple of 4
 29
 30# Import plugins.
 31try:
 32  import carbon.manhole 33except ImportError:
 34  pass
 35try:
indentation is not a multiple of 4
 97    elif processor == 'relay':
 98      setupRelayProcessor(root_service, settings)
 99    elif processor == 'write':
100      setupWriterProcessor(root_service, settings)101    else:
102      raise ValueError("Invalid pipeline processor '%s'" % processor)
103
indentation is not a multiple of 4
114    for processor in state.pipeline_processors:
115      processor.pipeline_ready()
116
117  from twisted.internet import reactor118  reactor.callWhenRunning(activate_processors)
119
120
indentation is not a multiple of 4
 43
 44
 45class CarbonRootService(MultiService):
 46  """Root Service that properly configures twistd logging""" 47
 48  def setServiceParent(self, parent):
 49    MultiService.setServiceParent(self, parent)
indentation is not a multiple of 4
219  writer_service = WriterService()
220  writer_service.setServiceParent(root_service)
221
222  if settings.USE_FLOW_CONTROL:223    events.cacheFull.addHandler(events.pauseReceivingMetrics)
224    events.cacheSpaceAvailable.addHandler(events.resumeReceivingMetrics)
indentation is not a multiple of 4
217  service.setServiceParent(root_service)
218
219  writer_service = WriterService()
220  writer_service.setServiceParent(root_service)221
222  if settings.USE_FLOW_CONTROL:
223    events.cacheFull.addHandler(events.pauseReceivingMetrics)
indentation is not a multiple of 4
216    interface=settings.CACHE_QUERY_INTERFACE)
217  service.setServiceParent(root_service)
218
219  writer_service = WriterService()220  writer_service.setServiceParent(root_service)
221
222  if settings.USE_FLOW_CONTROL:
indentation is not a multiple of 4
214    settings.CACHE_QUERY_PORT,
215    factory,
216    interface=settings.CACHE_QUERY_INTERFACE)
217  service.setServiceParent(root_service)218
219  writer_service = WriterService()
220  writer_service.setServiceParent(root_service)
indentation is not a multiple of 4
210
211  factory = ServerFactory()
212  factory.protocol = CacheManagementHandler
213  service = TCPServer(214    settings.CACHE_QUERY_PORT,
215    factory,
216    interface=settings.CACHE_QUERY_INTERFACE)
indentation is not a multiple of 4
209  from carbon.writer import WriterService
210
211  factory = ServerFactory()
212  factory.protocol = CacheManagementHandler213  service = TCPServer(
214    settings.CACHE_QUERY_PORT,
215    factory,
indentation is not a multiple of 4
208  from carbon.protocols import CacheManagementHandler
209  from carbon.writer import WriterService
210
211  factory = ServerFactory()212  factory.protocol = CacheManagementHandler
213  service = TCPServer(
214    settings.CACHE_QUERY_PORT,
indentation is not a multiple of 4
206def setupWriterProcessor(root_service, settings):
207  from carbon import cache  # NOQA Register CacheFeedingProcessor
208  from carbon.protocols import CacheManagementHandler
209  from carbon.writer import WriterService210
211  factory = ServerFactory()
212  factory.protocol = CacheManagementHandler