support rabbitmq 3.8.x in version check (#66855) (#68137)

* support rabbitmq 3.8.x in version check (#66855)

* support rabbitmq 3.8.x in version check

* Removed extraneous white space

(cherry picked from commit 6b017db05b)

* Add changelog fragment.

Co-authored-by: bitchkat <kjh@flyballdogs.com>
Co-authored-by: Matt Clay <matt@mystile.com>
pull/68671/head
Dmitriy Rabotyagov 6 years ago committed by GitHub
parent c6c4fbf4a1
commit 65866519e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- rabbitmq_policy - Fix version parsing for RabbitMQ 3.8.

@ -125,10 +125,16 @@ class RabbitMqPolicy(object):
def _rabbit_version(self):
status = self._exec(['status'], True, False, False)
# 3.7.x erlang style output
version_match = re.search('{rabbit,".*","(?P<version>.*)"}', status)
if version_match:
return Version(version_match.group('version'))
# 3.8.x style ouput
version_match = re.search('RabbitMQ version: (?P<version>.*)', status)
if version_match:
return Version(version_match.group('version'))
return None
def _list_policies(self):

Loading…
Cancel
Save