ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/LFNBaseName.py
(Generate patch)

Comparing COMP/CRAB/python/LFNBaseName.py (file contents):
Revision 1.23 by fanzago, Fri Jul 31 16:21:12 2009 UTC vs.
Revision 1.26 by fanzago, Mon Apr 15 15:20:23 2013 UTC

# Line 16 | Line 16 | def LFNBase(forced_path, PrimaryDataset=
16          PrimaryDataset = ProcessedDataset
17      if PrimaryDataset != '':
18          if ( PrimaryDataset[0] == '/' ):  PrimaryDataset=PrimaryDataset[1:]  
19 <    lfnbase = os.path.join(forced_path, getUserName(), PrimaryDataset, ProcessedDataset)
19 >    if forced_path.find('store/group')>0:
20 >        lfnbase = os.path.join(forced_path, PrimaryDataset, ProcessedDataset)
21 >    else:
22 >        lfnbase = os.path.join(forced_path, getUserName(), PrimaryDataset, ProcessedDataset)
23      if (publish == True):
24 +        checkSlash(ProcessedDataset)
25          checkLength(lfnbase, forced_path, PrimaryDataset, ProcessedDataset)
26      return lfnbase
27  
28 + def checkSlash(ProcessedDataset):
29 +    """
30 +    check if [USER].publish_data_name contains not allowed slash
31 +    """
32 +    import re
33 +    
34 +    #if (str(ProcessedDataset).find("/") > -1):
35 +    #        raise CrabException("Warning: [USER] publication_data_name contains a '/' characters that is not allowed. Please change the publication_data_name value")
36 +    m = re.findall("[^-\w_\.%]+", str(ProcessedDataset))
37 +    if (m != []):
38 +        common.logger.debug("check not allowed characters in the publication_data_name  = " + str(m))
39 +        raise CrabException("Warning: [USER] publication_data_name contains not allowed characters %s . Please change the publication_data_name value" % str(m))
40 +
41   def checkLength(lfnbase, forced_path, PrimaryDataset, ProcessedDataset):
42      """
43      """

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines