]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/nfs: delegation support in export/client block
authorVenky Shankar <vshankar@redhat.com>
Tue, 28 Oct 2025 08:08:31 +0000 (08:08 +0000)
committerVenky Shankar <vshankar@redhat.com>
Wed, 29 Oct 2025 05:50:29 +0000 (05:50 +0000)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/pybind/mgr/nfs/ganesha_conf.py

index 1c0fdfb987cb75d4aaa07979d16e0263d258842f..f22c7e2689cb0576074e645049c291404e196eb9 100644 (file)
@@ -328,10 +328,12 @@ class Client:
     def __init__(self,
                  addresses: List[str],
                  access_type: str,
-                 squash: str):
+                 squash: str,
+                 delegations: str):
         self.addresses = addresses
         self.access_type = access_type
         self.squash = squash
+        self.delegations: delegations
 
     @classmethod
     def from_client_block(cls, client_block: RawBlock) -> 'Client':
@@ -340,7 +342,8 @@ class Client:
             addresses = [addresses]
         return cls(addresses,
                    client_block.values.get('access_type', None),
-                   client_block.values.get('squash', None))
+                   client_block.values.get('squash', None),
+                   client_block.values.get('delegations', None))
 
     def to_client_block(self) -> RawBlock:
         result = RawBlock('CLIENT', values={'clients': self.addresses})
@@ -348,18 +351,21 @@ class Client:
             result.values['access_type'] = self.access_type
         if self.squash:
             result.values['squash'] = self.squash
+        if self.delegations:
+            result.values['delegations'] = self.delegations
         return result
 
     @classmethod
     def from_dict(cls, client_dict: Dict[str, Any]) -> 'Client':
         return cls(client_dict['addresses'], client_dict['access_type'],
-                   client_dict['squash'])
+                   client_dict['squash'], client_dict['delegations'])
 
     def to_dict(self) -> Dict[str, Any]:
         return {
             'addresses': self.addresses,
             'access_type': self.access_type,
-            'squash': self.squash
+            'squash': self.squash,
+            'delegations': self.delegations
         }
 
 class CephBlock: