15 |
|
### default is the copy local |
16 |
|
self.copy_local = 1 |
17 |
|
|
18 |
< |
if common.logger.debug: print 'CopyData __init__() : \n' |
18 |
> |
common.logger.debug("CopyData __init__() : \n") |
19 |
|
|
20 |
|
if (cfg_params.get('USER.copy_data',0) == '0') : |
21 |
|
msg = 'Cannot copy output if it has not \n' |
39 |
|
if (cfg_params.get("USER.storage_element").upper() != 'LOCAL'): |
40 |
|
self.copy_local = 0 |
41 |
|
|
42 |
< |
if common.logger.debug: |
43 |
< |
print "------ self.protocol = ", self.protocol |
44 |
< |
print "------ USER.storage_element = ", cfg_params.get("USER.storage_element") |
45 |
< |
print "------ self.copy_local = " , self.copy_local |
42 |
> |
common.logger.debug("------ self.protocol = " + self.protocol) |
43 |
> |
common.logger.debug("------ USER.storage_element = " + cfg_params.get("USER.storage_element")) |
44 |
> |
common.logger.debug("------ self.copy_local = " + str(self.copy_local)) |
45 |
|
|
46 |
|
|
47 |
|
def run(self): |
95 |
|
cmscpConfig.update(dest) |
96 |
|
print "------ source = ", key |
97 |
|
print "------ files = ", to_copy[key] |
98 |
< |
if common.logger.debug: |
100 |
< |
print "------ cmscpConfig = ", cmscpConfig |
98 |
> |
common.logger.debug("------ cmscpConfig = " + str(cmscpConfig)) |
99 |
|
|
100 |
|
results.update(self.performCopy(cmscpConfig)) |
101 |
|
return results |
107 |
|
returns a dictionary {with endpoint, fileList} |
108 |
|
''' |
109 |
|
|
110 |
< |
if common.logger.debug: print "CopyData in checkAvailableList() " |
110 |
> |
common.logger.debug("CopyData in checkAvailableList() ") |
111 |
|
# loop over jobs |
112 |
|
|
113 |
|
task=common._db.getTask(self.nj_list) |
118 |
|
InfileList = '' |
119 |
|
if ( job.runningJob['status'] in ['E','UE'] and job.runningJob[ 'wrapperReturnCode'] == 0): |
120 |
|
id_job = job['jobId'] |
121 |
< |
if common.logger.debug: print "------ id_job = ", id_job |
121 |
> |
common.logger.debug("------ id_job = " + str(id_job)) |
122 |
|
endpoint = job.runningJob['storage'] |
123 |
|
output_files = job.runningJob['lfn'] |
124 |
< |
if common.logger.debug: print "------ output_files = ", job.runningJob['lfn'] |
124 |
> |
common.logger.debug("------ output_files = " + str(job.runningJob['lfn'])) |
125 |
|
for file in output_files: |
126 |
|
InfileList += '%s,'%os.path.basename(file) |
127 |
< |
if common.logger.debug: print "------ InfileList = ", InfileList |
127 |
> |
common.logger.debug("------ InfileList = " + str(InfileList)) |
128 |
|
if to_copy.has_key(endpoint): |
129 |
|
to_copy[endpoint] = to_copy[endpoint] + InfileList |
130 |
|
else: |
143 |
|
|
144 |
|
for key in to_copy.keys(): |
145 |
|
to_copy[key] = to_copy[key][:-1] |
146 |
< |
if common.logger.debug: print "------ to_copy = ", to_copy |
146 |
> |
common.logger.debug("------ to_copy = " + str(to_copy)) |
147 |
|
return to_copy |
148 |
|
|
149 |
|
def performCopy(self, dict): |
150 |
|
""" |
151 |
|
call the cmscp class and do the copy |
152 |
|
""" |
155 |
– |
print "--->>> in performCopy" |
156 |
– |
|
153 |
|
from cmscp import cmscp |
154 |
|
doCopy = cmscp(dict) |
155 |
|
|