Ignore extra lines from Pivotal's RabbitMQ package

Pivotal's packaging of RabbitMQ shows a banner at the end of the plugin
listing talking about their official plugins. The start of the banner is
divided by a blank line so the changed plugin listing will now
break after the first empty line.

An example listing with the rabbitmq_management plugin enabled:

```
    $ rabbitmq-plugins list -E -m
    rabbitmq_management

    Pivotal officially maintains and supports the plugins:

      rabbitmq_auth_backend_ldap, rabbitmq_auth_mechanism_ssl,
      rabbitmq_consistent_hash_exchange, rabbitmq_federation,
      rabbitmq_federation_management, rabbitmq_jms_topic_exchange,
      rabbitmq_management, rabbitmq_management_agent,
      rabbitmq_mqtt, rabbitmq_shovel, rabbitmq_shovel_management,
      and rabbitmq_stomp.
```
reviewable/pr18780/r1
Björn Andersson 10 years ago
parent b8803306d1
commit c02e4195cf

@ -88,7 +88,14 @@ class RabbitMqPlugins(object):
return list() return list()
def get_all(self): def get_all(self):
return self._exec(['list', '-E', '-m'], True) list_output = self._exec(['list', '-E', '-m'], True)
plugins = []
for plugin in list_output:
if not plugin:
break
plugins.append(plugin)
return plugins
def enable(self, name): def enable(self, name):
self._exec(['enable', name]) self._exec(['enable', name])
@ -96,6 +103,7 @@ class RabbitMqPlugins(object):
def disable(self, name): def disable(self, name):
self._exec(['disable', name]) self._exec(['disable', name])
def main(): def main():
arg_spec = dict( arg_spec = dict(
names=dict(required=True, aliases=['name']), names=dict(required=True, aliases=['name']),

Loading…
Cancel
Save