1 '''
2 Bliss based File Transfer Implementation
3 '''
4 import urlparse
5
6 import errno
7 import sys
8 import os
9 import stat
10 import logging
11 import traceback
12 import time
13
14 sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../.."))
15
16 from pilot.api import State
17 from bigjob import logger
18 import bliss.saga as saga
19
21 """ BigData File Management for Pilot Data """
22
23
24
26 self.service_url = service_url
27 result = urlparse.urlparse(service_url)
28 self.host = result.netloc
29 self.query = result.path
30
31 self.__state=State.New
32
33
35 """ Returns security context that needs to be available on the distributed
36 node in order to access this Pilot Data """
37 return None
38
39
44
45
49
50
53
54
57
58
60 du_dir = os.path.join(self.path, str(du_id))
61 logger.debug("mkdir: " + du_dir)
62
63
64
67
68
71
72
73
78
79
80 - def get_du(self, du, target_url):
84
85
87 self.__remove_directory(os.path.join(self.path, du.id))
88
89
90
91
92
93 - def transfer(self, source_url, target_url):
95
98
99
101 result = urlparse.urlparse(target_url)
102 target_query = result.path
103
104
105
106
107
109 exc_type, exc_value, exc_traceback = sys.exc_info()
110 print "*** print_tb:"
111 traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
112 print "*** print_exception:"
113 traceback.print_exception(exc_type, exc_value, exc_traceback,
114 limit=2, file=sys.stdout)
115
116
117 if __name__ == "__main__":
118 go = GlobusOnlineFileAdaptor("http://drelu:bigjob@cli.globusonline.org?ep=drelu#egi&path=/ho")
119 go.transfer("go://cli.globusonline.org?ep=drelu#MacBook&path=/~/cert.tar.gz", "go://cli.globusonline.org?ep=xsede#kraken&path=/~/")
120