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 May 11, 2015
1 parent a6e1132 commit a87e6c2
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 20 deletions.
7 changes: 1 addition & 6 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
3 changes: 0 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions dogstatsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions tests/checks/integration/test_tomcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from aggregator import MetricsAggregator
from dogstatsd import Server
from jmxfetch import JMXFetch
from utils.pidfile import PidFile

STATSD_PORT = 8126

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

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/checks/mock/test_system_core.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down
1 change: 0 additions & 1 deletion win32/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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 a87e6c2

Please sign in to comment.