5
5
from cinder import interface
6
6
from cinder .objects import volume_type as vol_type_obj
7
7
from cinder .volume import driver as volume_driver
8
- from cinder .volume .drivers .netapp import options
8
+ from cinder .volume .drivers .netapp import options as na_opts
9
9
from cinder .volume .drivers .netapp .dataontap .client .client_cmode_rest import (
10
10
RestClient as RestNaServer ,
11
11
)
21
21
# Configuration options for dynamic NetApp driver
22
22
# Using cinder.volume.configuration approach for better abstraction
23
23
NETAPP_DYNAMIC_OPTS = [
24
- options .netapp_proxy_opts ,
25
- options .netapp_connection_opts ,
26
- options .netapp_transport_opts ,
27
- options .netapp_basicauth_opts ,
28
- options .netapp_provisioning_opts ,
29
- options .netapp_cluster_opts ,
30
- options .netapp_san_opts ,
31
- volume_driver .volume_opts ,
24
+ na_opts .netapp_connection_opts ,
25
+ na_opts .netapp_basicauth_opts ,
26
+ na_opts .netapp_transport_opts ,
27
+ na_opts .netapp_provisioning_opts ,
28
+ na_opts .netapp_support_opts ,
29
+ na_opts .netapp_san_opts ,
30
+ na_opts .netapp_cluster_opts ,
32
31
]
33
32
34
33
@@ -48,64 +47,11 @@ def __init__(self, *args, **kwargs):
48
47
Parent driver creates static connections during init. We defer
49
48
SVM connections until volume creation when we know which SVM to use.
50
49
"""
51
- self ._setup_configuration (** kwargs )
52
-
53
50
super ().__init__ (* args , ** kwargs )
54
51
self .client = None
55
52
self .ssc_library = None
56
53
self .perf_library = None
57
54
58
- def _setup_configuration (self , ** kwargs ):
59
- """Setup configuration using cinder.volume.configuration module."""
60
- from cinder .volume import configuration
61
-
62
- config_obj = kwargs .get ("configuration" , None )
63
-
64
- if config_obj :
65
- # here we can access any cinder-provided config .
66
- self .configuration = config_obj
67
- config_group = getattr (config_obj , "config_group" , "netapp_nvme" )
68
-
69
- # Register NetApp-specific options using configuration.append()
70
- # Following the exact pattern from upstream NetApp drivers
71
-
72
- try :
73
- for opt_group in NETAPP_DYNAMIC_OPTS :
74
- self .configuration .append_config_values (opt_group )
75
-
76
- LOG .info (
77
- "Registered NetApp configuration options for group: %s" ,
78
- config_group ,
79
- )
80
-
81
- except Exception as e :
82
- LOG .warning ("Failed to register configuration options: %s" , e )
83
- # Continue default configuration handling for backward compatibility
84
- else :
85
- # Testing/Fallback: Create configuration object with all options
86
- config_group = "netapp_nvme"
87
- self .configuration = configuration .Configuration (
88
- volume_driver .volume_opts , config_group = config_group
89
- )
90
-
91
- # Register additional NetApp options for testing
92
- try :
93
- for opt_group in NETAPP_DYNAMIC_OPTS :
94
- if (
95
- opt_group != volume_driver .volume_opts
96
- ): # Avoid duplicate registration
97
- self .configuration .append_config_values (opt_group )
98
-
99
- LOG .info (
100
- "Registered NetApp configuration options for testing group: %s" ,
101
- config_group ,
102
- )
103
-
104
- except Exception as e :
105
- LOG .warning (
106
- "Failed to register configuration options for testing: %s" , e
107
- )
108
-
109
55
def do_setup (self , context ):
110
56
"""Skip static NetApp connections, defer to volume creation time."""
111
57
LOG .info ("Skipping static setup, will connect to SVMs dynamically" )
@@ -952,6 +898,11 @@ def __init__(self, *args, **kwargs):
952
898
super ().__init__ (* args , ** kwargs )
953
899
self .library = NetappDynamicLibrary (self .DRIVER_NAME , "NVMe" , ** kwargs )
954
900
901
+ @staticmethod
902
+ def get_driver_options ():
903
+ """All options this driver supports."""
904
+ return [item for sublist in NETAPP_DYNAMIC_OPTS for item in sublist ]
905
+
955
906
def do_setup (self , context ):
956
907
"""Setup the driver."""
957
908
self .library .do_setup (context )
0 commit comments