Commit Graph

4 Commits

Author SHA1 Message Date
Jeff Quast
a154280b34 bugfix: trailing "...done" in rabbitmq output
Problem
-----------

Some versions of rabbitmq (v3.4.1) does not output any final
"...done" line in output of listings, but the given salt code
unconditionally removed the final line of output, which may
often result in inconsistent behavior of dependent state
functions, where the final line has a value that is significant.

Solution
-----------

This bugfix changes this output manipulation to be conditional,
matching only lines of ``"Listing ..."`` as the first, and
``"...done"`` as the last.

Details
---------

In my environment::

    [rabbitmq@db01 ~]$ rabbitmqctl list_vhosts
    Listing vhosts ...
    /

This causes issues in, for example, a vhost is attempted to
be created for '/' that already exists, if that vhost happens
to be the last one listed in command output, it is thought
non-existent, resulting in state failure::

    Failure: rabbitmq_vhost_|-rabbitmq-vhost_|-/_|-present: Creating vhost "/" ...
    Error: vhost_already_exists: /
2015-06-09 17:30:40 -07:00
Colton Myers
90cb448910 Fix rest of rabbitmq tests 2015-05-29 15:11:25 -06:00
Colton Myers
7736509c6b Fix rabbitmq test 2015-05-29 15:11:19 -06:00
Jayesh Kariya
a6f867630f adding rabbitmq unit test 2015-03-16 10:28:13 +05:30