@@ -91,7 +91,7 @@ def validate_remotepath(self, scan):
9191
9292 def check_server (self ):
9393 try :
94- nfs .check_server_tcp (self .remoteserver )
94+ nfs .check_server_tcp (self .remoteserver , self . transport )
9595 except nfs .NfsException as exc :
9696 raise xs_errors .XenError ('NFSVersion' ,
9797 opterr = exc .errstr )
@@ -226,6 +226,21 @@ def scan_exports(self, target):
226226 dom = nfs .scan_exports (target )
227227 print >> sys .stderr ,dom .toprettyxml ()
228228
229+ def _isvalidpathstring (self , path ):
230+ if not path .startswith ("/" ):
231+ return False
232+ l = self ._splitstring (path )
233+ for char in l :
234+ if char .isalpha ():
235+ continue
236+ elif char .isdigit ():
237+ continue
238+ elif char in ['/' ,'-' ,'_' ,'.' ,':' ]:
239+ continue
240+ else :
241+ return False
242+ return True
243+
229244class NFSFileVDI (FileSR .FileVDI ):
230245 def attach (self , sr_uuid , vdi_uuid ):
231246 try :
@@ -255,21 +270,6 @@ def clone(self, sr_uuid, vdi_uuid):
255270 os .utime (self .sr .path , (timestamp_after , timestamp_after ))
256271 return ret
257272
258- def _isvalidpathstring (self , path ):
259- if not path .startswith ("/" ):
260- return False
261- l = self ._splitstring (path )
262- for char in l :
263- if char .isalpha ():
264- continue
265- elif char .isdigit ():
266- continue
267- elif char in ['/' ,'-' ,'_' ,'.' ,':' ]:
268- continue
269- else :
270- return False
271- return True
272-
273273
274274
275275if __name__ == '__main__' :
0 commit comments