def split_datastore_path(datastore_path):
 splits = datastore_path.split('[', 1)[1].split(']', 1)
 datastore_name = None
 folder_path = None
 file_name = None
 if (len(splits) == 1):
  datastore_name = splits[0]
 else:
  (datastore_name, path) = splits
  splits = path.split('/')
  file_name = splits[(len(splits) - 1)]
  folder_path = path[:(- len(file_name))]
 return (datastore_name.strip(), folder_path.strip(), file_name.strip())

def split_datastore_path ( datastore_path ) : splits = datastore_path . split ( '[' , 1 ) [ 1 ] . split ( ']' , 1 ) datastore_name = None folder_path = None file_name = None if ( len ( splits ) == 1 ) : datastore_name = splits [ 0 ] else : ( datastore_name , path ) = splits splits = path . split ( '/' ) file_name = splits [ ( len ( splits ) - 1 ) ] folder_path = path [ : ( - len ( file_name ) ) ] return ( datastore_name . strip ( ) , folder_path . strip ( ) , file_name . strip ( ) )
split the vmware style datastore path to get the datastore name and the entity path .