]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: sanity check upgrade version 33802/head
authorSage Weil <sage@redhat.com>
Sat, 7 Mar 2020 16:06:40 +0000 (10:06 -0600)
committerSage Weil <sage@redhat.com>
Sat, 7 Mar 2020 16:06:40 +0000 (10:06 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 8cc007e6b176abaab87b38056474070ac61981b9..d86d01556fcca94e50ec8b945ac47b4ac796cebb 100644 (file)
@@ -2789,6 +2789,14 @@ receivers:
             raise OrchestratorError('upgrade is not supported in %s mode' % (
                 self.mode))
         if version:
+            try:
+                (major, minor, patch) = version.split('.')
+                assert int(minor) >= 0
+                assert int(patch) >= 0
+            except:
+                raise OrchestratorError('version must be in the form X.Y.Z (e.g., 15.2.3)')
+            if int(major) < 15 or (int(major) == 15 and int(minor) < 2):
+                raise OrchestratorError('cephadm only supports octopus (15.2.0) or later')
             target_name = self.container_image_base + ':v' + version
         elif image:
             target_name = image