]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: move DeploymentType to deploy.py
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 23 Sep 2023 19:22:40 +0000 (15:22 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 4 Oct 2023 19:17:57 +0000 (15:17 -0400)
The DeploymentType is used by a number of other classes and functions
and has no dependencies beyond enum and is safe to move.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py
src/cephadm/cephadmlib/deploy.py [new file with mode: 0644]

index b6692b399eeb3ad604cdaaba616e74081765ae4c..2b7c8a0a69a8983db6b348654f0e3334354000f6 100755 (executable)
@@ -18,7 +18,6 @@ import tempfile
 import time
 import errno
 import ssl
-from enum import Enum
 from typing import Dict, List, Tuple, Optional, Union, Any, Callable, IO, Sequence, TypeVar, cast, Iterable, TextIO
 
 import re
@@ -168,6 +167,7 @@ from cephadmlib.daemon_form import (
     create as daemon_form_create,
     register as register_daemon_form,
 )
+from cephadmlib.deploy import DeploymentType
 from cephadmlib.sysctl import install_sysctl, migrate_sysctl_dir
 from cephadmlib.firewalld import Firewalld, update_firewalld
 
@@ -202,17 +202,6 @@ class ContainerInfo:
                 and self.start == other.start
                 and self.version == other.version)
 
-
-class DeploymentType(Enum):
-    # Fresh deployment of a daemon.
-    DEFAULT = 'Deploy'
-    # Redeploying a daemon. Works the same as fresh
-    # deployment minus port checking.
-    REDEPLOY = 'Redeploy'
-    # Reconfiguring a daemon. Rewrites config
-    # files and potentially restarts daemon.
-    RECONFIG = 'Reconfig'
-
 ##################################
 
 
diff --git a/src/cephadm/cephadmlib/deploy.py b/src/cephadm/cephadmlib/deploy.py
new file mode 100644 (file)
index 0000000..9918437
--- /dev/null
@@ -0,0 +1,14 @@
+# deploy.py - fundamental deployment types
+
+from enum import Enum
+
+
+class DeploymentType(Enum):
+    # Fresh deployment of a daemon.
+    DEFAULT = 'Deploy'
+    # Redeploying a daemon. Works the same as fresh
+    # deployment minus port checking.
+    REDEPLOY = 'Redeploy'
+    # Reconfiguring a daemon. Rewrites config
+    # files and potentially restarts daemon.
+    RECONFIG = 'Reconfig'