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

* support rabbitmq 3.8.x in version check

* Removed extraneous white space
This commit is contained in:
bitchkat 2020-02-15 08:42:32 -06:00 committed by GitHub
parent b1de5d43fc
commit 6b017db05b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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):