diff --git a/agent.py b/agent.py index f4035859a8..9450f9a876 100755 --- a/agent.py +++ b/agent.py @@ -247,12 +247,7 @@ def main(): deprecate_old_command_line_tools() if command in COMMANDS_AGENT: - pid_file = PidFile('dd-agent') - - if options.clean: - pid_file.clean() - - agent = Agent(pid_file.get_path(), autorestart) + agent = Agent(PidFile('dd-agent').get_path(), autorestart) if command in START_COMMANDS: log.info('Agent version %s' % get_version()) diff --git a/config.py b/config.py index c27c6525e9..947abb3f09 100644 --- a/config.py +++ b/config.py @@ -73,8 +73,6 @@ def get_parsed_args(): dest='autorestart') parser.add_option('-d', '--dd_url', action='store', default=None, dest='dd_url') - parser.add_option('-c', '--clean', action='store_true', default=False, - dest='clean') parser.add_option('-u', '--use-local-forwarder', action='store_true', default=False, dest='use_forwarder') parser.add_option('-n', '--disable-dd', action='store_true', default=False, @@ -89,7 +87,6 @@ def get_parsed_args(): # Ignore parse errors options, args = Values({'autorestart': False, 'dd_url': None, - 'clean': False, 'disable_dd':False, 'use_forwarder': False}), [] return options, args diff --git a/dogstatsd.py b/dogstatsd.py index 70a7bed599..b161eace2c 100755 --- a/dogstatsd.py +++ b/dogstatsd.py @@ -439,8 +439,7 @@ def main(config_path=None): if not args or args[0] in COMMANDS_START_DOGSTATSD: reporter, server, cnf = init(config_path, use_watchdog=True, use_forwarder=opts.use_forwarder, args=args) - pid_file = PidFile('dogstatsd') - daemon = Dogstatsd(pid_file.get_path(), server, reporter, + daemon = Dogstatsd(PidFile('dogstatsd').get_path(), server, reporter, cnf.get('autorestart', False)) # If no args were passed in, run the server in the foreground. diff --git a/tests/checks/integration/test_tomcat.py b/tests/checks/integration/test_tomcat.py index f1358515a8..830f2d4e10 100644 --- a/tests/checks/integration/test_tomcat.py +++ b/tests/checks/integration/test_tomcat.py @@ -11,7 +11,6 @@ from aggregator import MetricsAggregator from dogstatsd import Server from jmxfetch import JMXFetch -from utils.pidfile import PidFile STATSD_PORT = 8126 @@ -42,7 +41,6 @@ class TestTomcat(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) @@ -63,7 +61,7 @@ def test_tomcat_metrics(self): while self.reporter.metrics is None: time.sleep(1) count += 1 - if count > 25:ga + if count > 25: raise Exception("No metrics were received in 25 seconds") metrics = self.reporter.metrics diff --git a/tests/checks/mock/test_java_jmx.py b/tests/checks/mock/test_java_jmx.py index 205e912341..ca358901f4 100644 --- a/tests/checks/mock/test_java_jmx.py +++ b/tests/checks/mock/test_java_jmx.py @@ -10,7 +10,6 @@ # datadog from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile from jmxfetch import JMXFetch from tests.checks.common import AgentCheckTest @@ -100,7 +99,6 @@ class JMXTestCase(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) diff --git a/tests/checks/mock/test_solr.py b/tests/checks/mock/test_solr.py index dcc06b5fe0..f37f6ee8dd 100644 --- a/tests/checks/mock/test_solr.py +++ b/tests/checks/mock/test_solr.py @@ -11,7 +11,6 @@ from dogstatsd import Server from jmxfetch import JMXFetch from tests.checks.common import Fixtures -from utils.pidfile import PidFile STATSD_PORT = 8127 @@ -42,7 +41,6 @@ class JMXTestCase(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) diff --git a/tests/checks/mock/test_system_core.py b/tests/checks/mock/test_system_core.py index 8dc65c4c3c..5d92d8d309 100644 --- a/tests/checks/mock/test_system_core.py +++ b/tests/checks/mock/test_system_core.py @@ -1,7 +1,7 @@ import mock import psutil -from tests.common import AgentCheckTest +from tests.checks.common import AgentCheckTest from utils.platform import Platform if Platform.is_mac(): diff --git a/win32/agent.py b/win32/agent.py index fa93cd68f0..3e8f157060 100644 --- a/win32/agent.py +++ b/win32/agent.py @@ -51,7 +51,6 @@ def __init__(self, args): opts, args = Values({ 'autorestart': False, 'dd_url': None, - 'clean': False, 'use_forwarder': True, 'disabled_dd': False }), []