summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/smb/internal.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/smb/internal.py')
-rw-r--r--src/pybind/mgr/smb/internal.py40
1 files changed, 1 insertions, 39 deletions
diff --git a/src/pybind/mgr/smb/internal.py b/src/pybind/mgr/smb/internal.py
index 3571ed44400..57e7a0c0278 100644
--- a/src/pybind/mgr/smb/internal.py
+++ b/src/pybind/mgr/smb/internal.py
@@ -4,7 +4,7 @@ resources that the internal store holds.
from typing import Collection, Tuple, Type, TypeVar
from . import resources
-from .enums import AuthMode, ConfigNS, State
+from .enums import ConfigNS, State
from .proto import (
ConfigEntry,
ConfigStore,
@@ -14,7 +14,6 @@ from .proto import (
Simplifiable,
)
from .resources import SMBResource
-from .results import ErrorResult
from .utils import one
T = TypeVar('T')
@@ -108,43 +107,6 @@ class ClusterEntry(ResourceEntry):
def get_cluster(self) -> resources.Cluster:
return self.get_resource_type(resources.Cluster)
- def create_or_update(self, resource: Simplifiable) -> State:
- assert isinstance(resource, resources.Cluster)
- try:
- previous = self.config_entry.get()
- except KeyError:
- previous = None
- current = resource.to_simplified()
- if current == previous:
- return State.PRESENT
- elif previous is None:
- self.config_entry.set(current)
- return State.CREATED
- # cluster is special in that is has some fields that we do not
- # permit changing.
- prev = getattr(
- resources.Cluster, '_resource_config'
- ).object_from_simplified(previous)
- if resource.auth_mode != prev.auth_mode:
- raise ErrorResult(
- resource,
- 'auth_mode value may not be changed',
- status={'existing_auth_mode': prev.auth_mode},
- )
- if resource.auth_mode == AuthMode.ACTIVE_DIRECTORY:
- assert resource.domain_settings
- assert prev.domain_settings
- if resource.domain_settings.realm != prev.domain_settings.realm:
- raise ErrorResult(
- resource,
- 'domain/realm value may not be changed',
- status={
- 'existing_domain_realm': prev.domain_settings.realm
- },
- )
- self.config_entry.set(current)
- return State.UPDATED
-
class ShareEntry(ResourceEntry):
"""Share resource getter/setter for the smb internal data store(s)."""