Skip to content

Commit 4637251

Browse files
authored
MTV refactor, order files and classes (#2246)
* remove MTV resource, Move Resource constants to class * remove MTV resource, Move Resource constants to class * Use `dict`, list` and `|` for typing * Remove NOQA
1 parent 30e8ca8 commit 4637251

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+208
-344
lines changed

ocp_resources/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any, Optional
22

3-
from ocp_resources.constants import NOT_FOUND_ERROR_EXCEPTION_DICT, TIMEOUT_30SEC
3+
from ocp_resources.utils.constants import NOT_FOUND_ERROR_EXCEPTION_DICT, TIMEOUT_30SEC
44
from ocp_resources.resource import NamespacedResource
55
from timeout_sampler import TimeoutSampler
66

ocp_resources/cdi_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md
22

33
from typing import Any, Dict, List, Optional
4-
from ocp_resources.constants import PROTOCOL_ERROR_EXCEPTION_DICT, TIMEOUT_4MINUTES
4+
from ocp_resources.utils.constants import PROTOCOL_ERROR_EXCEPTION_DICT, TIMEOUT_4MINUTES
55
from ocp_resources.resource import Resource
66
from timeout_sampler import TimeoutSampler
77

ocp_resources/daemonset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import kubernetes
22

3-
from ocp_resources.constants import PROTOCOL_ERROR_EXCEPTION_DICT, TIMEOUT_4MINUTES
3+
from ocp_resources.utils.constants import PROTOCOL_ERROR_EXCEPTION_DICT, TIMEOUT_4MINUTES
44
from ocp_resources.resource import NamespacedResource
55
from timeout_sampler import TimeoutSampler
66

ocp_resources/datavolume.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ocp_resources.constants import (
1+
from ocp_resources.utils.constants import (
22
TIMEOUT_1MINUTE,
33
TIMEOUT_2MINUTES,
44
TIMEOUT_4MINUTES,

ocp_resources/deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any, Dict, Optional
44
from timeout_sampler import TimeoutSampler, TimeoutWatch
55

6-
from ocp_resources.constants import PROTOCOL_ERROR_EXCEPTION_DICT, TIMEOUT_4MINUTES
6+
from ocp_resources.utils.constants import PROTOCOL_ERROR_EXCEPTION_DICT, TIMEOUT_4MINUTES
77
from ocp_resources.resource import NamespacedResource, MissingRequiredArgumentError
88

99

ocp_resources/endpoint_slice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ocp_resources.constants import TIMEOUT_4MINUTES
1+
from ocp_resources.utils.constants import TIMEOUT_4MINUTES
22
from ocp_resources.resource import MissingRequiredArgumentError, NamespacedResource
33

44

ocp_resources/endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ocp_resources.constants import TIMEOUT_4MINUTES
1+
from ocp_resources.utils.constants import TIMEOUT_4MINUTES
22
from ocp_resources.resource import MissingRequiredArgumentError, NamespacedResource
33

44

ocp_resources/forklift_controller.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from ocp_resources.mtv import MTV
21
from ocp_resources.resource import NamespacedResource
32

43

5-
class ForkliftController(NamespacedResource, MTV):
4+
class ForkliftController(NamespacedResource):
65
"""
76
Migration Toolkit For Virtualization (MTV) ForkliftController Resource
87
"""

ocp_resources/hook.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from ocp_resources.constants import TIMEOUT_4MINUTES
2-
from ocp_resources.mtv import MTV
1+
from ocp_resources.utils.constants import TIMEOUT_4MINUTES
32
from ocp_resources.resource import NamespacedResource
43

54

6-
class Hook(NamespacedResource, MTV):
5+
class Hook(NamespacedResource):
76
"""
87
Migration Tool for Virtualization (MTV) Plan's Hook Resource.
98
"""

ocp_resources/host.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from ocp_resources.constants import TIMEOUT_4MINUTES
2-
from ocp_resources.mtv import MTV
1+
from ocp_resources.utils.constants import TIMEOUT_4MINUTES
32
from ocp_resources.resource import NamespacedResource
43

54

6-
class Host(NamespacedResource, MTV):
5+
class Host(NamespacedResource):
76
"""
87
Migration Toolkit For Virtualization (MTV) Host resource.
98
"""
@@ -41,7 +40,6 @@ def __init__(
4140
self.provider_namespace = provider_namespace
4241
self.secret_name = secret_name or f"{self.name}-secret"
4342
self.secret_namespace = secret_namespace or self.namespace
44-
self.condition_message_ready = self.ConditionMessage.HOST_READY
4543

4644
def to_dict(self) -> None:
4745
super().to_dict()

0 commit comments

Comments
 (0)