Project

General

Profile

Feature #3074

Better integration of cat_XMLResult.py with xargs

Added by Igor Sfiligoi about 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Igor Sfiligoi
Category:
Factory
Target version:
Start date:
10/25/2012
Due date:
% Done:

100%

Estimated time:
Stakeholders:
Duration:

Description

The OSG factory operators tend to use cat_XMLResult.py together with xargs.

One example:
entry_ls -fo CMS_T3_US_Omaha_tusker fecms 20121022 | xargs cat_XMLResult.py

The problem is:
If there are too many input files, xargs will call cat_XMLResult.py multiple time.

The result is an invalid XML output...
i.e.

<OSGTestResultSet>
is printed out multiple time.

Jeff asked for a fix.

History

#1 Updated by Igor Sfiligoi about 8 years ago

  • Status changed from New to Assigned
The proposal on the table is to add two new attributes:
  • One to disable the printout of the two offending lines.
    The resulting output by itself will not be a valid XML file, but can easily be wrapped by the caller.
  • One to treat single and multiple input files the same way.
    Currently, cat_XML behaves in a different way if given a single vs multiple files.

#2 Updated by Igor Sfiligoi about 8 years ago

  • Status changed from Assigned to Feedback
  • Assignee changed from Igor Sfiligoi to Parag Mhashilkar
  • % Done changed from 0 to 90

Implemented as options -raw and -forcemulti.

Committed in
branch_v2plus_igor_3074

It was tested on the UCSD OSG gfactory and approved by Jeff.

Parag: Can you please have a quick look before I merge it into v2plus?

#3 Updated by Igor Sfiligoi about 8 years ago

This has been tested on the OSG ITB factory, and it does not seem to be introducing any problems.

#4 Updated by Parag Mhashilkar about 8 years ago

  • Assignee changed from Parag Mhashilkar to Igor Sfiligoi

Looks okay to me. Just one comment, you are doing a hard string comparison as below. Do you think there won't be any white spaces in the beginning of the line? If that's the case then feel free to merge.

if raw_out and (l[:2]=="<?"):
[...]
if l[:15]=="<OSGTestResult ":

#5 Updated by Igor Sfiligoi about 8 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

We control the script that writes out the XML file, so unless we change it, things are guaranteed to work.

Merged in both v2plus and master.

#6 Updated by Parag Mhashilkar about 8 years ago

  • Target version changed from v2_7_x to 293

#7 Updated by Parag Mhashilkar over 7 years ago

  • Target version changed from 293 to v2_7

Also available in: Atom PDF