Skip to content

Commit

Permalink
[core] remove old option --clean
Browse files Browse the repository at this point in the history
It's a legacy command which shouldn't be needed after #1435
  • Loading branch information
degemer committed Apr 20, 2015
1 parent d0219e1 commit f119848
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 20 deletions.
7 changes: 1 addition & 6 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,7 @@ def main():
return 3

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())
Expand Down
3 changes: 0 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,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,
Expand All @@ -90,7 +88,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
Expand Down
3 changes: 1 addition & 2 deletions dogstatsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,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.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_cassandra_jmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -37,7 +36,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)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_java_jmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# datadog
from aggregator import MetricsAggregator
from dogstatsd import Server
from utils.pidfile import PidFile
from jmxfetch import JMXFetch
from common import AgentCheckTest

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -37,7 +36,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)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_tomcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion win32/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def __init__(self, args):
opts, args = Values({
'autorestart': False,
'dd_url': None,
'clean': False,
'use_forwarder': True,
'disabled_dd': False
}), []
Expand Down

0 comments on commit f119848

Please sign in to comment.