@@ -57,7 +57,7 @@ type ganesha_v2_export_FSAL = {
5757 # "FSAL" ? ganesha_v2_export_FSAL
5858 # FSAL_VFS
5959 " pnfs" ? boolean = false
60- " fsid_type" ? string with match (SELF , ' ^(None| One64| Major64| Two64| uuid| Two32| Dev| Device)$ ' )
60+ " fsid_type" ? choice( ' None ' , ' One64' , ' Major64' , ' Two64' , ' uuid' , ' Two32' , ' Dev' , ' Device' )
6161 # FSAL_GLUSTER
6262 " glfs_log" ? string = " /tmp/gfapi.log"
6363 " hostname" ? string # Mandatory
@@ -71,26 +71,40 @@ type ganesha_v2_export_FSAL = {
7171 " PNFS" ? ganesha_v2_export_FSAL_PNFS
7272};
7373
74- type ganesha_v2_protocol = string with match (SELF, ' ^((NFS)?[vV]?[34]|9P)$' );
75- type ganesha_v2_SecType = string with match (SELF, ' ^(none|sys|krb5[ip]?)$' );
76- type ganesha_v2_Transports = string with match (SELF, ' ^(UDP|TCP)$' );
74+ type ganesha_v2_protocol = choice(' 3' , ' 4' , ' NFS3' , ' NFS4' , ' V3' , ' V4' , ' NFSv3' , ' NFSv4' , ' 9P' );
75+ type ganesha_v2_SecType = choice(' none' , ' sys' , ' krb5' , ' krb5i' , ' krb5p' );
76+ type ganesha_v2_Transports = choice(' UDP' , ' TCP' );
77+ type ganesha_v2_delegations = choice(' None' , ' read' , ' write' , ' readwrite' , ' r' , ' w' , ' rw' );
7778
7879@{ Ganesha Export Permissions for EXPORT_DEFAULLTS, EXPORT and CLIENT sections @}
7980type ganesha_v2_export_permissions = {
80- " Access_Type" ? string = ' None' with match (SELF , ' ^(None|RW|RO| MDONLY| MDONLY_RO)$ ' )
81+ " Access_Type" ? choice( ' None' , ' RW ' , ' RO ' , ' MDONLY' , ' MDONLY_RO' ) = ' None '
8182 " Anonymous_gid" ? long = -2
8283 " Anonymous_uid" ? long = -2
83- " Delegations" ? string with match (SELF, ' ^(None|read|write|readwrite|r|w|rw)$ ' )
84+ " Delegations" ? ganesha_v2_delegations
8485 " Disable_ACL" ? boolean = false
8586 " DisableReaddirPlus" ? boolean = false
8687 " Manage_Gids" ? boolean = false
8788 " NFS_Commit" ? boolean = false
8889 " PrivilegedPort" ? boolean = false
8990 " Protocols" ? ganesha_v2_protocol[] = list (' 3' , ' 4' , ' 9P' )
9091 " SecType" ? ganesha_v2_SecType[] = list (' none' , ' sys' )
91- " Squash" ? string = " root_squash" with match (SELF,
92- ' ^((root|all)(_?squash)?|no_root_squash|none|noidsquash)$'
93- )
92+ " Squash" ? choice(
93+ ' root' ,
94+ ' root_squash' ,
95+ ' rootsquash' ,
96+ ' rootid' ,
97+ ' root_id_squash' ,
98+ ' rootidsquash' ,
99+ ' all' ,
100+ ' all_squash' ,
101+ ' allsquash' ,
102+ ' all_anomnymous' ,
103+ ' allanonymous' ,
104+ ' no_root_squash' ,
105+ ' none' ,
106+ ' noidsquash'
107+ ) = " root_squash"
94108 " Transports" ? ganesha_v2_Transports[] = list (' UDP' , ' TCP' )
95109 " Trust_Readdir_Negative_Cache" ? boolean = false
96110};
@@ -130,8 +144,19 @@ type ganesha_v2_exports = {
130144 " UseCookieVerifier" ? boolean = true
131145};
132146
133- type ganesha_v2_log_level = string with match (SELF,
134- ' ^(NULL|FATAL|MAJ|CRIT|WARN|EVENT|INFO|DEBUG|MID_DEBUG|M_DBG|FULL_DEBUG|F_DBG)$'
147+ type ganesha_v2_log_level = choice(
148+ ' NULL' ,
149+ ' FATAL' ,
150+ ' MAJ' ,
151+ ' CRIT' ,
152+ ' WARN' ,
153+ ' EVENT' ,
154+ ' INFO' ,
155+ ' DEBUG' ,
156+ ' MID_DEBUG' ,
157+ ' M_DBG' ,
158+ ' FULL_DEBUG' ,
159+ ' F_DBG'
135160);
136161
137162@{ Check for valid Ganesha Log Component names @}
@@ -146,8 +171,19 @@ function is_ganesha_v2_log_Components = {
146171};
147172type ganesha_v2_log_Components = ganesha_v2_log_level{} with is_ganesha_v2_log_Components(SELF);
148173
149- type ganesha_v2_log_time_format = string with match (SELF,
150- ' ^(ganesha|true|local|8601|ISO-8601|ISO 8601|ISO|syslog|syslog_usec|false|none|user_defined)$'
174+ type ganesha_v2_log_time_format = choice(
175+ ' ganesha' ,
176+ ' true' ,
177+ ' local' ,
178+ ' 8601' ,
179+ ' ISO-8601' ,
180+ ' ISO 8601' ,
181+ ' ISO' ,
182+ ' syslog' ,
183+ ' syslog_usec' ,
184+ ' false' ,
185+ ' none' ,
186+ ' user_defined'
151187);
152188
153189@{ Ganesha Log Format subsection @}
@@ -173,8 +209,8 @@ type ganesha_v2_log_Format = {
173209@{ Ganesha Log Facility subsection @}
174210type ganesha_v2_log_Facility = {
175211 " destination" : string
176- " enable" ? string = ' idle' with match (SELF , ' ^(idle| active| default)$ ' )
177- " headers" ? string = ' all' with match (SELF, ' ^(none|component| all)$ ' )
212+ " enable" ? choice( ' idle' , ' active' , ' default' ) = ' idle '
213+ " headers" ? choice( ' none ' , ' component ' , ' all' ) = ' all'
178214 " max_level" ? ganesha_v2_log_level = ' FULL_DEBUG'
179215 " name" ? string
180216};
@@ -283,7 +319,7 @@ type ganesha_v2_proxy_remote_server = {
283319 " RPC_Client_Timeout" ? long(0..) = 60
284320 " Remote_PrincipalName" ? string
285321 " Retry_SleepTime" ? long(0..) = 10
286- " Sec_Type" ? string = ' krb5' with match (SELF , ' ^krb5[ip]?$ ' )
322+ " Sec_Type" ? choice( ' none ' , ' krb5' , ' krb5i ' , ' krb5p ' )= ' krb5 '
287323 " Srv_Addr" ? type_ip = " 127.0.0.1"
288324 " Use_Privileged_Client_Port" ? boolean = false
289325};
@@ -314,7 +350,7 @@ type ganesha_v2_proxy = {
314350@{ Ganesha GPFS section @}
315351type ganesha_v2_GPFS = {
316352 include ganesha_v2_fsalsettings_all
317- " Delegations" ? string with match (SELF, ' ^(None|read|write|readwrite|r|w|rw)$ ' )
353+ " Delegations" ? ganesha_v2_delegations
318354 " fsal_grace" ? boolean = false
319355 " fsal_trace" ? boolean = true
320356 " pnfs_file" ? boolean = false
0 commit comments