Merge lp:~cjwatson/rabbitfixture/enabled-plugins-file into lp:rabbitfixture

Proposed by Colin Watson
Status: Merged
Merged at revision: 42
Proposed branch: lp:~cjwatson/rabbitfixture/enabled-plugins-file
Merge into: lp:rabbitfixture
Diff against target: 49 lines (+7/-7)
2 files modified
rabbitfixture/server.py (+4/-4)
rabbitfixture/tests/test_server.py (+3/-3)
To merge this branch: bzr merge lp:~cjwatson/rabbitfixture/enabled-plugins-file
Reviewer Review Type Date Requested Status
Adam Collard (community) Approve
LAZR Developers Pending
Review via email: mp+364977@code.launchpad.net

Commit message

Use RABBITMQ_ENABLED_PLUGINS_FILE to disable all plugins.

Description of the change

Setting RABBITMQ_PLUGINS_DIR breaks as of rabbitmq-server 3.6.0, because it now always loads the rabbit_common and ranch plugins at startup.

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rabbitfixture/server.py'
2--- rabbitfixture/server.py 2019-03-04 16:59:42 +0000
3+++ rabbitfixture/server.py 2019-03-22 18:04:34 +0000
4@@ -140,8 +140,10 @@
5 self.logfile = os.path.join(self.homedir, 'server.log')
6 if self.nodename is None:
7 self.nodename = os.path.basename(self.useFixture(TempDir()).path)
8- self.pluginsdir = self.useFixture(TempDir()).path
9- self.pluginsfile = os.devnull
10+ self.pluginsfile = os.path.join(
11+ self.useFixture(TempDir()).path, 'enabled_plugins')
12+ with open(self.pluginsfile, 'w') as pluginsfile:
13+ pluginsfile.write('[].\n')
14
15 @property
16 def fq_nodename(self):
17@@ -190,8 +192,6 @@
18 self.useFixture(EnvironmentVariableFixture(
19 "RABBITMQ_NODENAME", self.config.fq_nodename))
20 self.useFixture(EnvironmentVariableFixture(
21- "RABBITMQ_PLUGINS_DIR", self.config.pluginsdir))
22- self.useFixture(EnvironmentVariableFixture(
23 "RABBITMQ_ENABLED_PLUGINS_FILE", self.config.pluginsfile))
24 self._errors = []
25 self.addDetail('rabbit-errors', Content(
26
27=== modified file 'rabbitfixture/tests/test_server.py'
28--- rabbitfixture/tests/test_server.py 2019-03-04 16:59:42 +0000
29+++ rabbitfixture/tests/test_server.py 2019-03-22 18:04:34 +0000
30@@ -129,8 +129,8 @@
31 self.assertIsInstance(resources.mnesiadir, six.string_types)
32 self.assertIsInstance(resources.logfile, six.string_types)
33 self.assertIsInstance(resources.nodename, six.string_types)
34- self.assertIsInstance(resources.pluginsdir, six.string_types)
35- self.assertEqual(resources.pluginsfile, os.devnull)
36+ with open(resources.pluginsfile) as pluginsfile:
37+ self.assertEqual("[].\n", pluginsfile.read())
38
39 def test_passed_to_init(self):
40 args = dict(
41@@ -173,7 +173,7 @@
42 "RABBITMQ_NODE_PORT": str(config.port),
43 "RABBITMQ_DIST_PORT": str(config.dist_port),
44 "RABBITMQ_NODENAME": config.fq_nodename,
45- "RABBITMQ_PLUGINS_DIR": config.pluginsdir,
46+ "RABBITMQ_ENABLED_PLUGINS_FILE": config.pluginsfile,
47 }
48 self.assertEqual(
49 expected, {name: os.getenv(name) for name in expected})

Subscribers

People subscribed via source and target branches

to all changes: