Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
C
CASTOR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
castor
CASTOR
Commits
0c5a40d9
Commit
0c5a40d9
authored
Feb 12, 2018
by
Giuseppe Lo Presti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for "short" output
parent
fefc16f8
Pipeline
#311617
passed with stages
in 23 minutes and 48 seconds
Changes
1
Pipelines
11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
checkreplicas
hsmtools/checkreplicas
+8
-2
No files found.
hsmtools/checkreplicas
View file @
0c5a40d9
...
...
@@ -39,15 +39,17 @@ import cx_Oracle
############################################################
# usage function
def
usage
(
exitCode
):
print
'Usage : '
+
sys
.
argv
[
0
]
+
' [-h|--help] [-m] fileId|castorFileName'
print
'Usage : '
+
sys
.
argv
[
0
]
+
' [-h|--help] [-m]
[-s]
fileId|castorFileName'
print
'Query NameServer and Stager databases to get the footprint of a file in CASTOR'
print
' -m print output with a key=value formatting'
print
' -s short output: print namespace and disk metadata only'
sys
.
exit
(
exitCode
)
# first parse the options
shortOutput
=
False
printFunc
=
castor_tools
.
prettyPrintTable
try
:
options
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hm'
,
[
'help'
])
options
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'hm
s
'
,
[
'help'
])
except
Exception
,
e
:
print
e
usage
(
1
)
...
...
@@ -56,6 +58,8 @@ for f, v in options:
usage
(
0
)
elif
f
==
'-m'
:
printFunc
=
castor_tools
.
keyValuePrintTable
elif
f
==
'-s'
:
shortOutput
=
True
else
:
print
"unknown option : "
+
f
usage
(
1
)
...
...
@@ -112,6 +116,8 @@ try:
titles
=
[
'DISKCOPYID'
,
'STATUS'
,
'CREATIONTIME'
,
'POOL'
,
'LOCATION'
,
'AVAIL'
,
'DCSIZE'
,
'FILESIZE'
,
'GCWEIGHT'
]
print
'
\n
### Stager DiskCopy information'
printFunc
(
titles
,
rows
)
if
shortOutput
:
sys
.
exit
(
0
)
print
'
\n
### Stager DiskCopy physical status (stat + cksum)'
for
f
in
rows
:
(
host
,
path
)
=
f
[
4
]
.
split
(
':'
)
...
...
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