-
Notifications
You must be signed in to change notification settings - Fork 1
/
stagerSDMSHPSS.py
58 lines (42 loc) · 1.26 KB
/
stagerSDMSHPSS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
b'This script requires python 3.4'
"""
Script to stage from HPSS to staging area.
For detailed documentation, see: README_StageXRD.md
"""
import sys
import os
import re
import json
import logging as log
import time
import socket
import datetime
import shlex, subprocess
from subprocess import STDOUT, check_output
from mongoUtil import mongoDbUtil
import pymongo
from pymongo import results
from pymongo import errors
from pymongo import bulk
from pprint import pprint
from stagerSDMS import stagerSDMS
##############################################
# -- Check for a proper Python Version
if sys.version[0:3] < '3.0':
print ('Python version 3.0 or greater required (found: {0}).'.format(sys.version[0:5]))
sys.exit(-1)
# ____________________________________________________________________________
def main():
"""Initialize and run"""
# -- Connect to mongoDB
dbUtil = mongoDbUtil("", "admin")
stager = stagerSDMS(dbUtil, 'stagingRequest.json')
# -- Clean dummy staged files
stager.cleanDummyStagedFiles()
# -- Stage from HPSS to staging area
stager.stageFromHPSS()
dbUtil.close()
# ____________________________________________________________________________
if __name__ == "__main__":
sys.exit(main())