forked from celery/celery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--> Added Multi default logfiles and pidfiles paths [Description]: --> Changed the default paths for log files & pid files to be '/var/log/celery' and '/var/run/celery' --> Handled by creating the respective paths if not exist. --> Used os.makedir(path,if_exists=True) [Unit Test Added]: --> .travis.yml - config updated with 'before install'. --> t/unit/apps/test_multi.py - Changed the default log files & pid files paths wherever required.
- Loading branch information
Showing
3 changed files
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,8 +113,8 @@ def assert_line_in(name, args): | |
|
||
def _args(name, *args): | ||
return args + ( | ||
'--pidfile={0}.pid'.format(name), | ||
'--logfile={0}%I.log'.format(name), | ||
'--pidfile=/var/run/celery/{}.pid'.format(name), | ||
'--logfile=/var/log/celery/{}%I.log'.format(name), | ||
'--executable={0}'.format(sys.executable), | ||
'', | ||
) | ||
|
@@ -176,7 +176,7 @@ def setup(self): | |
self.p = Mock(name='p') | ||
self.p.options = { | ||
'--executable': 'python', | ||
'--logfile': 'foo.log', | ||
'--logfile': '/var/log/celery/foo.log', | ||
} | ||
self.p.namespaces = {} | ||
self.node = Node('[email protected]', options={'-A': 'proj'}) | ||
|
@@ -194,10 +194,10 @@ def test_from_kwargs(self): | |
'--executable={0}'.format(n.executable), | ||
'-O fair', | ||
'-n [email protected]', | ||
'--logfile=foo%I.log', | ||
'--logfile=/var/log/celery/foo%I.log', | ||
'-Q q1,q2', | ||
'--max-tasks-per-child=30', | ||
'--pidfile=foo.pid', | ||
'--pidfile=/var/run/celery/foo.pid', | ||
'', | ||
]) | ||
|
||
|
@@ -275,7 +275,7 @@ def test_handle_process_exit__signalled(self): | |
|
||
def test_logfile(self): | ||
assert self.node.logfile == self.expander.return_value | ||
self.expander.assert_called_with('%n%I.log') | ||
self.expander.assert_called_with('/var/log/celery/%n%I.log') | ||
|
||
|
||
class test_Cluster: | ||
|
@@ -375,8 +375,8 @@ def test_getpids(self): | |
assert sorted(node_0.argv) == sorted([ | ||
'', | ||
'--executable={0}'.format(node_0.executable), | ||
'--logfile=foo%I.log', | ||
'--pidfile=foo.pid', | ||
'--logfile=/var/log/celery/foo%I.log', | ||
'--pidfile=/var/run/celery/foo.pid', | ||
'-m celery worker --detach', | ||
'-n [email protected]', | ||
]) | ||
|
@@ -386,8 +386,8 @@ def test_getpids(self): | |
assert sorted(node_1.argv) == sorted([ | ||
'', | ||
'--executable={0}'.format(node_1.executable), | ||
'--logfile=bar%I.log', | ||
'--pidfile=bar.pid', | ||
'--logfile=/var/log/celery/bar%I.log', | ||
'--pidfile=/var/run/celery/bar.pid', | ||
'-m celery worker --detach', | ||
'-n [email protected]', | ||
]) | ||
|
@@ -404,8 +404,8 @@ def __init__(self, path): | |
|
||
def read_pid(self): | ||
try: | ||
return {'foo.pid': 10, | ||
'bar.pid': 11}[self.path] | ||
return {'/var/run/celery/foo.pid': 10, | ||
'/var/run/celery/bar.pid': 11}[self.path] | ||
except KeyError: | ||
raise ValueError() | ||
self.Pidfile.side_effect = pids |