From 6005c6c64145a16a0ff2cea8d4be5d2a8a697318 Mon Sep 17 00:00:00 2001 From: Quentin Madec Date: Fri, 17 Apr 2015 15:36:27 -0400 Subject: [PATCH] [core] remove old option --clean It's a legacy command which shouldn't be needed after #1435 --- agent.py | 7 +------ config.py | 3 --- dogstatsd.py | 3 +-- tests/checks/integration/test_tomcat.py | 2 -- tests/checks/mock/test_java_jmx.py | 2 -- tests/checks/mock/test_solr.py | 2 -- tests/checks/mock/test_system_core.py | 2 +- win32/agent.py | 1 - 8 files changed, 3 insertions(+), 19 deletions(-) diff --git a/agent.py b/agent.py index 9b7447d6e5..c9a0bd6008 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 8fe2829f6f..484885f418 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 210c419700..8bb5aa138b 100644 --- a/tests/checks/integration/test_tomcat.py +++ b/tests/checks/integration/test_tomcat.py @@ -4,7 +4,6 @@ import threading from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile import os from jmxfetch import JMXFetch @@ -36,7 +35,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) 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 fb816d4fdd..590d1f81a3 100644 --- a/tests/checks/mock/test_solr.py +++ b/tests/checks/mock/test_solr.py @@ -4,7 +4,6 @@ import threading from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile import os from jmxfetch import JMXFetch @@ -39,7 +38,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 }), []