Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 17, 2022. It is now read-only.

Commit 66efde8

Browse files
committed
Call check_supervisor() before connecting to Supervisor (fixes #10)
1 parent 38c15d7 commit 66efde8

4 files changed

Lines changed: 6 additions & 10 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setuptools.setup(
88
name = "supermann",
9-
version = '2.1.2',
9+
version = '2.1.3',
1010

1111
author = "Sam Clements",
1212
author_email = "[email protected]",

supermann/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
from supermann.core import Supermann
66

7-
__version__ = '2.1.1'
7+
__version__ = '2.1.3'
88
__author__ = 'Sam Clements <[email protected]>'
99
__all__ = ['Supermann']

supermann/command.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,5 @@ def main():
7979
memmon = supermann.memmon.MemoryMonitor.from_args(*args.memmon)
8080
self.connect(supermann.signals.process, memmon.process)
8181

82-
# These methods check that Supermann is running as a child of the
83-
# Supervisor process, and ensures basic information is logged
84-
self.check_supervisor()
85-
self.check_riemann()
86-
8782
# Supermann will attempt to run forever
8883
self.run()

supermann/core.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ def __init__(self, host=None, port=None):
2727

2828
# The Supervisor listener and client take their configuration from
2929
# the environment variables provided by Supervisor
30+
self.check_supervisor()
3031
self.supervisor = supermann.supervisor.Supervisor()
3132

33+
self.check_riemann(host, port)
3234
self.riemann = riemann_client.client.QueuedClient(
3335
riemann_client.transport.TCPTransport(host, port))
3436

@@ -121,8 +123,7 @@ def check_supervisor(self):
121123

122124
return True
123125

124-
def check_riemann(self):
126+
def check_riemann(self, host, port):
125127
"""Adds some basic information about the Riemann server to the log"""
126128
log = supermann.utils.getLogger(self.riemann)
127-
log.info("Using Riemann protobuf server at {0}:{1}".format(
128-
*self.riemann.transport.address))
129+
log.info("Using Riemann protobuf server at {0}:{1}".format(host, port))

0 commit comments

Comments
 (0)