@@ -41,12 +41,9 @@ class NFSGanesha(ContainerDaemonForm):
4141 def for_daemon_type (cls , daemon_type : str ) -> bool :
4242 return cls .daemon_type == daemon_type
4343
44- def __init__ (self ,
45- ctx ,
46- fsid ,
47- daemon_id ,
48- config_json ,
49- image = DEFAULT_IMAGE ):
44+ def __init__ (
45+ self , ctx , fsid , daemon_id , config_json , image = DEFAULT_IMAGE
46+ ):
5047 # type: (CephadmContext, str, Union[int, str], Dict, str) -> None
5148 self .ctx = ctx
5249 self .fsid = fsid
@@ -70,7 +67,9 @@ def init(cls, ctx, fsid, daemon_id):
7067 return cls (ctx , fsid , daemon_id , fetch_configs (ctx ), ctx .image )
7168
7269 @classmethod
73- def create (cls , ctx : CephadmContext , ident : DaemonIdentity ) -> 'NFSGanesha' :
70+ def create (
71+ cls , ctx : CephadmContext , ident : DaemonIdentity
72+ ) -> 'NFSGanesha' :
7473 return cls .init (ctx , ident .fsid , ident .daemon_id )
7574
7675 @property
@@ -86,8 +85,9 @@ def _get_container_mounts(self, data_dir):
8685 if self .rgw :
8786 cluster = self .rgw .get ('cluster' , 'ceph' )
8887 rgw_user = self .rgw .get ('user' , 'admin' )
89- mounts [os .path .join (data_dir , 'keyring.rgw' )] = \
90- '/var/lib/ceph/radosgw/%s-%s/keyring:z' % (cluster , rgw_user )
88+ mounts [
89+ os .path .join (data_dir , 'keyring.rgw' )
90+ ] = '/var/lib/ceph/radosgw/%s-%s/keyring:z' % (cluster , rgw_user )
9191 return mounts
9292
9393 def customize_container_mounts (
@@ -99,19 +99,24 @@ def customize_container_mounts(
9999 @staticmethod
100100 def get_container_envs ():
101101 # type: () -> List[str]
102- envs = [
103- 'CEPH_CONF=%s' % (CEPH_DEFAULT_CONF )
104- ]
102+ envs = ['CEPH_CONF=%s' % (CEPH_DEFAULT_CONF )]
105103 return envs
106104
107105 @staticmethod
108106 def get_version (ctx , container_id ):
109107 # type: (CephadmContext, str) -> Optional[str]
110108 version = None
111- out , err , code = call (ctx ,
112- [ctx .container_engine .path , 'exec' , container_id ,
113- NFSGanesha .entrypoint , '-v' ],
114- verbosity = CallVerbosity .QUIET )
109+ out , err , code = call (
110+ ctx ,
111+ [
112+ ctx .container_engine .path ,
113+ 'exec' ,
114+ container_id ,
115+ NFSGanesha .entrypoint ,
116+ '-v' ,
117+ ],
118+ verbosity = CallVerbosity .QUIET ,
119+ )
115120 if code == 0 :
116121 match = re .search (r'NFS-Ganesha Release\s*=\s*[V]*([\d.]+)' , out )
117122 if match :
@@ -131,7 +136,9 @@ def validate(self):
131136 if self .required_files :
132137 for fname in self .required_files :
133138 if fname not in self .files :
134- raise Error ('required file missing from config-json: %s' % fname )
139+ raise Error (
140+ 'required file missing from config-json: %s' % fname
141+ )
135142
136143 # check for an RGW config
137144 if self .rgw :
0 commit comments