From 337a722ce3e7c4c96c0b1f75bbd88c0ecced809b Mon Sep 17 00:00:00 2001
From: Dan Smith <dansmith@redhat.com>
Date: Thu, 3 Oct 2013 08:14:18 -0700
Subject: [PATCH] Sync three-part RPC versions support from Oslo

Change-Id: Ia93e7a6d978374e0dcf49c2be230c67e41a7bd14
---
 nova/openstack/common/rpc/common.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/nova/openstack/common/rpc/common.py b/nova/openstack/common/rpc/common.py
index e37911d4e815..2dee2a500273 100644
--- a/nova/openstack/common/rpc/common.py
+++ b/nova/openstack/common/rpc/common.py
@@ -449,10 +449,22 @@ def version_is_compatible(imp_version, version):
     """
     version_parts = version.split('.')
     imp_version_parts = imp_version.split('.')
+    try:
+        rev = version_parts[2]
+    except IndexError:
+        rev = 0
+    try:
+        imp_rev = imp_version_parts[2]
+    except IndexError:
+        imp_rev = 0
+
     if int(version_parts[0]) != int(imp_version_parts[0]):  # Major
         return False
     if int(version_parts[1]) > int(imp_version_parts[1]):  # Minor
         return False
+    if (int(version_parts[1]) == int(imp_version_parts[1]) and
+            int(rev) > int(imp_rev)):  # Revision
+        return False
     return True