Commit bc44a955 authored by Zoltan Mathe's avatar Zoltan Mathe
Browse files

Merge branch 'v8r6-PhC-170405' into 'master'

[v8r6] Small fixes

See merge request !325
parents 484fddef 6695e6a1
......@@ -748,6 +748,12 @@ def printPfnMetadata( lfnList, seList, check = False, exists = False, summary =
# take all seList in replicas and add a fake '' to printout the SE name
seList = [''] + sorted( set( se for lfn in replicas for se in replicas[lfn] ) )
if replicas:
if check:
res = fc.getFileMetadata( lfnList )
if res['OK']:
lfnMetadataDict = res['Value']['Successful']
else:
lfnMetadataDict = {}
for se in seList:
fileList = [url for url in lfnList if se in replicas.get( url, [] )]
if not fileList:
......@@ -767,9 +773,8 @@ def printPfnMetadata( lfnList, seList, check = False, exists = False, summary =
if exists and not pfnMetadata.get( 'Size' ):
metadata['Successful'][url][se].update( {'Exists':'Zero size'} )
if check:
res1 = fc.getFileMetadata( url )
if res1['OK']:
lfnMetadata = res1['Value']['Successful'][url]
lfnMetadata = lfnMetadataDict.get( url )
if lfnMetadata:
ok = True
diff = 'False -'
for field in ( 'Checksum', 'Size' ):
......@@ -782,6 +787,8 @@ def printPfnMetadata( lfnList, seList, check = False, exists = False, summary =
metadata['Successful'][url][se]['MatchLFN'] = ok if ok else diff
else:
metadata['Successful'][url]['MatchLFN'] = ok if ok else diff
else:
metadata['Successful'][url]['MatchLFN'] = 'No LFN metadata'
for url in seMetadata['Failed']:
metadata['Failed'].setdefault( url, {} )[se] = seMetadata['Failed'][url] if not exists else {'Exists': False}
else:
......
......@@ -473,7 +473,13 @@ class TransformationPlugin( DIRACTransformationPlugin ):
typesWithNoCheck = self.util.getPluginParam( 'NoCheckTypes', ['Merge', 'MCMerge', 'Replication', 'Removal'] )
fromSEs = set( resolveSEGroup( self.util.getPluginParam( 'FromSEs', [] ) ) )
# This flag defaults to True for DataStripping transformations
addAncestors = self.util.getPluginParam( 'UseAncestors', bool( self.params['Type'] == 'DataStripping' ) )
lfn = self.transReplicas.keys()[0]
res = self.util.getBookkeepingMetadata( lfn, 'FileType' )
if not res['OK']:
self.util.logError( "Error getting file metadata", res['Message'] )
return res
fileType = res['Value'][lfn]
addAncestors = self.util.getPluginParam( 'UseAncestors', bool( self.params['Type'] == 'DataStripping' ) and fileType != 'FULL.DST' )
maxTime = self.util.getPluginParam( 'MaxTimeAllowed', 0 )
self.util.readCacheFile( self.workDirectory )
if not self.transReplicas:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment