Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
etf
cmssam
Commits
5129896e
Commit
5129896e
authored
Mar 12, 2007
by
Andrea Sciaba
Browse files
Updated to latest version
parent
f8238606
Changes
16
Hide whitespace changes
Inline
Side-by-side
SiteTests/MonteCarlo/cms-MC-test/FwkJobRep/TaskState.py
View file @
5129896e
...
...
@@ -11,8 +11,8 @@ The object is instantiated with a directory that contains the task.
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: TaskState.py,v 1.
1
2007/0
2
/1
9
1
5
:1
1:52
asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: TaskState.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:28
asciaba Exp $"
__author__
=
"evansde@fnal.gov"
...
...
SiteTests/MonteCarlo/cms-MC-test/FwkJobRep/__init__.py
View file @
5129896e
...
...
@@ -9,8 +9,8 @@ Runtime Safe.
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: __init__.py,v 1.
1
2007/0
2
/1
9
1
5
:1
1:52
asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: __init__.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:28
asciaba Exp $"
__author__
=
"evansde@fnal.gov"
__all__
=
[]
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/IMProvDoc.py
View file @
5129896e
...
...
@@ -10,8 +10,8 @@ add an IMProv structure to a ScriptObject
ToDo - Add XPath search abilities to this object in future
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: IMProvDoc.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: IMProvDoc.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
import
os
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/IMProvException.py
View file @
5129896e
...
...
@@ -5,8 +5,8 @@ _IMProvException_
Exception classes for IMProv package
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: IMProvException.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: IMProvException.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
import
exceptions
import
inspect
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/IMProvLoader.py
View file @
5129896e
...
...
@@ -7,8 +7,8 @@ Sax based parser for reading an IMProv XML file and
converting it into a tree of IMProvNodes
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: IMProvLoader.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: IMProvLoader.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
from
xml.sax.handler
import
ContentHandler
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/IMProvNode.py
View file @
5129896e
...
...
@@ -5,8 +5,8 @@ _IMProvNode_
Dictionary based node container for constructing
IMProv Documents from
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: IMProvNode.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: IMProvNode.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
from
xml.dom.minidom
import
Element
,
Text
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/IMProvQuery.py
View file @
5129896e
...
...
@@ -6,8 +6,8 @@ Lightweight XPath like querying tool for extracting information
from an IMProvNode structure
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: IMProvQuery.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: IMProvQuery.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
import
re
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/PredicateFunctions.py
View file @
5129896e
...
...
@@ -11,8 +11,8 @@ The first argument accepted by a Predicate Function must be
an IMProvNode instance.
"""
__revision__
=
"$Id: PredicateFunctions.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: PredicateFunctions.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__author__
=
"evansde@fnal.gov"
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/PredicateOperators.py
View file @
5129896e
...
...
@@ -5,8 +5,8 @@ _PredicateOperators_
Operator implementation for Predicates
"""
__revision__
=
"$Id: PredicateOperators.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: PredicateOperators.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__author__
=
"evansde@fnal.gov"
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/Predicates.py
View file @
5129896e
...
...
@@ -8,8 +8,8 @@ a predicate object tree structure that can be evaluated on a
node
"""
__revision__
=
"$Id: Predicates.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $"
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: Predicates.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__author__
=
"evansde@fnal.gov"
import
shlex
...
...
SiteTests/MonteCarlo/cms-MC-test/IMProv/__init__.py
View file @
5129896e
#!/usr/bin/env python
__version__
=
"$Version$"
# $Id: __init__.py,v 1.
1
2007/0
2
/1
9
1
5
:1
2:2
8 asciaba Exp $
# $Id: __init__.py,v 1.
2
2007/0
3
/1
2
1
0
:1
3:0
8 asciaba Exp $
"""
...
...
SiteTests/MonteCarlo/cms-MC-test/StageOut/Impl/RFCP1Impl.py
0 → 100644
View file @
5129896e
#!/usr/bin/env python
"""
_RFCP1Impl_
Implementation of StageOutImpl interface for RFIO in Castor-1
"""
import
os
from
StageOut.Registry
import
registerStageOutImpl
from
StageOut.StageOutImpl
import
StageOutImpl
from
StageOut.Execute
import
runCommand
class
RFCP1Impl
(
StageOutImpl
):
"""
_RFCP1Impl_
Implement interface for rfcp command
"""
run
=
staticmethod
(
runCommand
)
def
createSourceName
(
self
,
protocol
,
pfn
):
"""
_createSourceName_
uses pfn
"""
return
"%s"
%
pfn
def
createOutputDirectory
(
self
,
targetPFN
):
"""
_createOutputDirectory_
create dir with group permission
"""
targetdir
=
os
.
path
.
dirname
(
targetPFN
)
checkdircmd
=
"rfstat %s > /dev/null "
%
targetdir
print
"Check dir existence : %s"
%
checkdircmd
try
:
checkdirexitCode
=
self
.
run
(
checkdircmd
)
except
Exception
,
ex
:
msg
=
"Warning: Exception while invoking command:
\n
"
msg
+=
"%s
\n
"
%
checkdircmd
msg
+=
"Exception: %s
\n
"
%
str
(
ex
)
msg
+=
"Go on anyway..."
print
msg
pass
if
checkdirexitCode
:
mkdircmd
=
"rfmkdir -m 775 -p %s"
%
targetdir
print
"=> creating the dir : %s"
%
mkdircmd
try
:
self
.
run
(
mkdircmd
)
except
Exception
,
ex
:
msg
=
"Warning: Exception while invoking command:
\n
"
msg
+=
"%s
\n
"
%
mkdircmd
msg
+=
"Exception: %s
\n
"
%
str
(
ex
)
msg
+=
"Go on anyway..."
print
msg
pass
else
:
print
"=> dir already exists... do nothing."
def
createStageOutCommand
(
self
,
sourcePFN
,
targetPFN
,
options
=
None
):
"""
_createStageOutCommand_
Build an rfcp command
"""
original_size
=
os
.
stat
(
sourcePFN
)[
6
]
print
"Local File Size is: %s"
%
original_size
result
=
"rfcp "
if
options
!=
None
:
result
+=
" %s "
%
options
result
+=
" %s "
%
sourcePFN
result
+=
" %s "
%
targetPFN
result
+=
"; DEST_SIZE=`rfstat %s | grep Size | cut -f2 -d:` ; if [ $DEST_SIZE ] && [ '%s' == $DEST_SIZE ]; then exit 0; else echo
\"
Error: Size Mismatch between local and SE
\"
; exit 60311 ; fi "
%
(
targetPFN
,
original_size
)
return
result
def
removeFile
(
self
,
pfnToRemove
):
"""
_removeFile_
CleanUp pfn provided: specific for Castor-1
"""
command
=
"stageclr -M %s ; nsrm %s"
%
pfnToRemove
self
.
executeCommand
(
command
)
registerStageOutImpl
(
"rfcp-1"
,
RFCP1Impl
)
SiteTests/MonteCarlo/cms-MC-test/StageOut/Impl/RFCP2Impl.py
0 → 100644
View file @
5129896e
#!/usr/bin/env python
"""
_RFCP2Impl_
Implementation of StageOutImpl interface for RFIO in Castor-2
"""
import
os
from
StageOut.Registry
import
registerStageOutImpl
from
StageOut.StageOutImpl
import
StageOutImpl
from
StageOut.Execute
import
runCommand
class
RFCP2Impl
(
StageOutImpl
):
"""
_RFCP2Impl_
Implement interface for rfcp command
"""
run
=
staticmethod
(
runCommand
)
def
createSourceName
(
self
,
protocol
,
pfn
):
"""
_createSourceName_
uses pfn
"""
return
"%s"
%
pfn
def
createOutputDirectory
(
self
,
targetPFN
):
"""
_createOutputDirectory_
create dir with group permission
"""
targetdir
=
os
.
path
.
dirname
(
targetPFN
)
checkdircmd
=
"rfstat %s > /dev/null "
%
targetdir
print
"Check dir existence : %s"
%
checkdircmd
try
:
checkdirexitCode
=
self
.
run
(
checkdircmd
)
except
Exception
,
ex
:
msg
=
"Warning: Exception while invoking command:
\n
"
msg
+=
"%s
\n
"
%
checkdircmd
msg
+=
"Exception: %s
\n
"
%
str
(
ex
)
msg
+=
"Go on anyway..."
print
msg
pass
if
checkdirexitCode
:
mkdircmd
=
"rfmkdir -m 775 -p %s"
%
targetdir
print
"=> creating the dir : %s"
%
mkdircmd
try
:
self
.
run
(
mkdircmd
)
except
Exception
,
ex
:
msg
=
"Warning: Exception while invoking command:
\n
"
msg
+=
"%s
\n
"
%
mkdircmd
msg
+=
"Exception: %s
\n
"
%
str
(
ex
)
msg
+=
"Go on anyway..."
print
msg
pass
else
:
print
"=> dir already exists... do nothing."
def
createStageOutCommand
(
self
,
sourcePFN
,
targetPFN
,
options
=
None
):
"""
_createStageOutCommand_
Build an rfcp command
"""
original_size
=
os
.
stat
(
sourcePFN
)[
6
]
print
"Local File Size is: %s"
%
original_size
result
=
"rfcp "
if
options
!=
None
:
result
+=
" %s "
%
options
result
+=
" %s "
%
sourcePFN
result
+=
" %s "
%
targetPFN
result
+=
"; DEST_SIZE=`rfstat %s | grep Size | cut -f2 -d:` ; if [ $DEST_SIZE ] && [ '%s' == $DEST_SIZE ]; then exit 0; else echo
\"
Error: Size Mismatch between local and SE
\"
; exit 60311 ; fi "
%
(
targetPFN
,
original_size
)
return
result
def
removeFile
(
self
,
pfnToRemove
):
"""
_removeFile_
CleanUp pfn provided: specific for Castor-1
"""
command
=
"stager_rm -M %s ; nsrm %s"
%
pfnToRemove
self
.
executeCommand
(
command
)
registerStageOutImpl
(
"rfcp-2"
,
RFCP2Impl
)
SiteTests/MonteCarlo/cms-MC-test/StageOut/Impl/__init__.py
View file @
5129896e
...
...
@@ -19,4 +19,5 @@ __all__ = []
import
SRMImpl
#import DCCPImpl
import
RFCPImpl
#import RFIOImpl
import
RFCP1Impl
import
RFCP2Impl
SiteTests/MonteCarlo/cms-MC-test/StageOut/StageOutError.py
View file @
5129896e
...
...
@@ -6,8 +6,8 @@ General Exception class for JC modules
"""
__version__
=
"$Revision: 1.
1
$"
__revision__
=
"$Id: StageOutError.py,v 1.
1
2007/0
2
/1
9
1
5:08:10
asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__revision__
=
"$Id: StageOutError.py,v 1.
2
2007/0
3
/1
2
1
0:13:44
asciaba Exp $"
import
exceptions
import
inspect
...
...
SiteTests/MonteCarlo/cms-MC-test/StageOut/__init__.py
View file @
5129896e
...
...
@@ -8,7 +8,7 @@ command name provided in the Site Config File
"""
__all__
=
[]
__revsion__
=
"$Id: __init__.py,v 1.
1
2007/0
2
/1
9
1
5:08:10
asciaba Exp $"
__version__
=
"$Revision: 1.
1
$"
__revsion__
=
"$Id: __init__.py,v 1.
2
2007/0
3
/1
2
1
0:13:44
asciaba Exp $"
__version__
=
"$Revision: 1.
2
$"
__author__
=
"evansde@fnal.gov"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment