gug-cvs Mailing List for Grid Underground (Page 3)
Status: Planning
Brought to you by:
szferi
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(67) |
Oct
(232) |
Nov
(76) |
Dec
(36) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(100) |
Feb
(89) |
Mar
(44) |
Apr
(71) |
May
(34) |
Jun
(81) |
Jul
(43) |
Aug
(42) |
Sep
(1) |
Oct
(87) |
Nov
(11) |
Dec
(9) |
2007 |
Jan
(203) |
Feb
(149) |
Mar
(94) |
Apr
(70) |
May
(35) |
Jun
(27) |
Jul
(4) |
Aug
|
Sep
(18) |
Oct
|
Nov
|
Dec
|
From: Nagy Z. <zs...@us...> - 2007-05-29 11:44:03
|
Update of /cvsroot/gug/gug/gug/host In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9401/gug/host Modified Files: ctl.py http.py Log Message: GugHTTPSConnection Index: http.py =================================================================== RCS file: /cvsroot/gug/gug/gug/host/http.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** http.py 4 Apr 2007 14:13:43 -0000 1.19 --- http.py 29 May 2007 11:44:01 -0000 1.20 *************** *** 243,247 **** try: # from OpenSSL import SSL ! import gug.ssl self.socket = gug.ssl.Connection(context, self.socket) except: --- 243,247 ---- try: # from OpenSSL import SSL ! import gug.ssl self.socket = gug.ssl.Connection(context, self.socket) except: Index: ctl.py =================================================================== RCS file: /cvsroot/gug/gug/gug/host/ctl.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ctl.py 4 Apr 2007 14:13:18 -0000 1.27 --- ctl.py 29 May 2007 11:44:00 -0000 1.28 *************** *** 42,49 **** self.lock = thread.allocate_lock() if self.secure_ports: for i in network_config['certificates'].keys(): # XXX: make this more sophisticated # from OpenSSL import SSL - import gug.ssl tls_interface = network_config['certificates'][i] ctx = gug.ssl.Context(gug.ssl.SSLv23_METHOD) --- 42,53 ---- self.lock = thread.allocate_lock() if self.secure_ports: + try: + import gug.ssl + except: + log.error('No OpenSSL library found!') + return for i in network_config['certificates'].keys(): # XXX: make this more sophisticated # from OpenSSL import SSL tls_interface = network_config['certificates'][i] ctx = gug.ssl.Context(gug.ssl.SSLv23_METHOD) |
From: Szalai F. <sz...@us...> - 2007-05-29 11:07:18
|
Update of /cvsroot/gug/gug/gug/ssl In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27597/gug/ssl Modified Files: connection.c connection.h Log Message: add makefile implementation Index: connection.c =================================================================== RCS file: /cvsroot/gug/gug/gug/ssl/connection.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** connection.c 20 Mar 2007 09:43:34 -0000 1.4 --- connection.c 29 May 2007 11:07:11 -0000 1.5 *************** *** 390,395 **** ssl_ConnectionObject_makefile(ssl_ConnectionObject *self, PyObject *args) { printf ("ssl_makefile\n"); ! return NULL; } --- 390,409 ---- ssl_ConnectionObject_makefile(ssl_ConnectionObject *self, PyObject *args) { + PyObject *meth, *ret; + PyObject *attr_name; + printf ("ssl_makefile\n"); ! if ((meth = PyObject_GetAttrString(self->sock, "makefile")) == NULL) { ! Py_RETURN_NONE; ! } ! ret = PyEval_CallObject(meth, args); ! Py_DECREF(meth); ! attr_name = PyString_FromString("_sock"); ! if (PyObject_SetAttr(ret, attr_name, (PyObject *)self) < 0) { ! printf ("bajvan!\n"); ! Py_RETURN_NONE; ! } ! ! return ret; } Index: connection.h =================================================================== RCS file: /cvsroot/gug/gug/gug/ssl/connection.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** connection.h 20 Mar 2007 09:43:35 -0000 1.4 --- connection.h 29 May 2007 11:07:11 -0000 1.5 *************** *** 117,125 **** (PyCFunction)ssl_ConnectionObject_listen, METH_VARARGS, ! "listen for connections made to the socket."}, {"makefile", (PyCFunction)ssl_ConnectionObject_makefile, METH_VARARGS, ! "return a file object associated with the socket"}, */ {"recv", (PyCFunction)ssl_ConnectionObject_recv, --- 117,125 ---- (PyCFunction)ssl_ConnectionObject_listen, METH_VARARGS, ! "listen for connections made to the socket."}, */ {"makefile", (PyCFunction)ssl_ConnectionObject_makefile, METH_VARARGS, ! "return a file object associated with the socket"}, {"recv", (PyCFunction)ssl_ConnectionObject_recv, |
From: Gergo C. <cs...@us...> - 2007-05-24 07:15:50
|
Update of /cvsroot/gug/gug/gug/host/handler In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8649 Modified Files: turl.py Added Files: .cvsignore Log Message: better exceptionhandling in handle_Put --- NEW FILE: .cvsignore --- *.pyc Index: turl.py =================================================================== RCS file: /cvsroot/gug/gug/gug/host/handler/turl.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** turl.py 17 May 2007 09:35:59 -0000 1.7 --- turl.py 24 May 2007 07:15:48 -0000 1.8 *************** *** 27,36 **** try: self.unregister() try: f = file(self.filename,'wb') except: log.error() ! os.makedirs(os.path.dirname(self.filename)) ! f = file(self.filename,'wb') self.alter_status('request_inprogress') print 'serving PUT', f.name --- 27,37 ---- try: self.unregister() + if not os.path.exists(os.path.dirname(self.filename) + "/"): + os.makedirs(os.path.dirname(self.filename)) try: f = file(self.filename,'wb') except: log.error() ! raise self.alter_status('request_inprogress') print 'serving PUT', f.name |
From: Gergo C. <cs...@us...> - 2007-05-24 07:14:00
|
Update of /cvsroot/gug/gug/fuse In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8186 Modified Files: gugfs.py gugprocfs.py Log Message: clean ups, cluster manager support for gugprocfs Index: gugprocfs.py =================================================================== RCS file: /cvsroot/gug/gug/fuse/gugprocfs.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gugprocfs.py 17 May 2007 09:35:59 -0000 1.1 --- gugprocfs.py 24 May 2007 07:13:56 -0000 1.2 *************** *** 7,12 **** from gug.common.share import random_name from urllib import URLopener ! import os, stat, errno # some spaghetti to make it usable without fuse-py being installed for i in True, False: --- 7,13 ---- from gug.common.share import random_name from urllib import URLopener + from gug.common.ogsa_bes import overall_states ! import os, stat, errno, time # some spaghetti to make it usable without fuse-py being installed for i in True, False: *************** *** 63,103 **** st = MyStat() ! if path == '/' or path == '/gis': st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 return st ! if path[:5] != '/gis/': return -errno.ENOENT ! fpath = path[5:] ! lfpath = len(fpath) ! client = get_client(self.gis_peers[0]) ! services = client.get() ! for service in services: ! servsid = service[0]['sid'] ! if servsid == fpath: ! st.st_mode = stat.S_IFDIR | 0755 ! st.st_nlink = 2 ! return st ! else: ! lservsid = len(servsid) ! if servsid + "/" == fpath[:lservsid+1]: ! st.st_mode = stat.S_IFREG | 0444 ! st.st_nlink = 1 ! fname = fpath[lservsid+1:] ! if fname == 'description': ! st.st_size = len(service[1]) ! elif fname == 'urls': ! urls = '' ! for url in service[0]['urls']: ! urls += url + "\n" ! st.st_size = len(urls) ! else: ! st.st_size = len(service[0][fname]) ! return st return None - def readdir(self, path, offset): #file("/tmp/gugfsreaddir","a").write("%i %s\n" % (self.ncount, path)) --- 64,146 ---- st = MyStat() ! if path == '/' or path == '/gis' or path == '/cm': st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 return st ! if path[:5] != '/gis/' and path[:4] != '/cm/': return -errno.ENOENT ! if path[:5] == '/gis/': ! fpath = path[5:] ! lfpath = len(fpath) ! try: ! gis = find_working_service(self.gis_peers, 'InformationSystem') ! except: ! return -errno.EIO ! services = gis.get() ! for service in services: ! servsid = service[0]['sid'] ! if servsid == fpath: ! st.st_mode = stat.S_IFDIR | 0755 ! st.st_nlink = 2 ! return st ! else: ! lservsid = len(servsid) ! if servsid + "/" == fpath[:lservsid+1]: ! st.st_mode = stat.S_IFREG | 0444 ! st.st_nlink = 1 ! fname = fpath[lservsid+1:] ! if fname == 'description': ! st.st_size = len(service[1]) ! elif fname == 'urls': ! urls = '' ! for url in service[0]['urls']: ! urls += url + "\n" ! st.st_size = len(urls) ! elif fname == 'resourcetype': ! restype = '' ! for res in service[0]['resourcetype']: ! restype += res + "\n" ! st.st_size = len(res) ! else: ! st.st_size = len(service[0][fname]) ! return st ! if path[:4] == '/cm/': ! fpath = path[4:] ! lfpath = len(fpath) ! try: ! cm = find_working_service(self.gis_peers, 'ClusterManager') ! except: ! return -errno.EIO ! jobs = cm.status('') ! for job in jobs: ! jobid = job[0] ! if jobid == fpath: ! st.st_mode = stat.S_IFDIR | 0755 ! st.st_nlink = 2 ! return st ! else: ! ljobid = len(jobid) ! if jobid + "/" == fpath[:ljobid+1]: ! st.st_mode = stat.S_IFREG | 0444 ! st.st_nlink = 1 ! fname = fpath[ljobid+1:] ! if fname == 'last_check_time' or fname == 'submit_time': ! ss = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime(job[1][fname])) ! st.st_size = len(ss) ! elif fname == 'status': ! ss = overall_states[job[1][fname]] ! st.st_size = len(ss) ! elif fname == 'exit_code': ! if job[1][fname]: ! st.st_size = len(str(job[1][fname])) ! else: ! st.st_size = 0 ! elif job[1].has_key(fname): ! st.st_size = len(job[1][fname]) ! return st return None def readdir(self, path, offset): #file("/tmp/gugfsreaddir","a").write("%i %s\n" % (self.ncount, path)) *************** *** 106,140 **** yield fuse.Direntry("..") if path == '/': ! yield fuse.Direntry("gis") return ! if path[:5] != '/gis/' and path != '/gis': return #file("/tmp/gugfsreaddir","a").write("%i 2: proc dir, gis_peers[0]: %s\n" % (self.ncount, self.gis_peers[0])) ! client = get_client(self.gis_peers[0]) ! print "client: " + str(client) ! services = client.get() ! if path == "/gis": ! #file("/tmp/gugfsreaddir","a").write("%i 3: proc dir, list services: %i\n" % (self.ncount, len(services))) for service in services: ! yield fuse.Direntry(str(service[0]['sid'])) ! return ! for service in services: ! if path == "/gis/" + service[0]['sid']: ! yield fuse.Direntry('description') ! yield fuse.Direntry('origin') ! yield fuse.Direntry('type') ! yield fuse.Direntry('urls') ! yield fuse.Direntry('timelife') ! yield fuse.Direntry('ttl') return def unlink(self, path): - #file("/tmp/gugfsunlink", "a").write("%i %s\n" % (self.ncount, path)) return -errno.EACCES def rmdir(self, path): ! #file("/tmp/gugfsrmdir", "a").write("%i %s\n" % (self.ncount, path)) return -errno.EACCES --- 149,225 ---- yield fuse.Direntry("..") if path == '/': ! try: ! gis = find_working_service(self.gis_peers, 'InformationSystem') ! yield fuse.Direntry("gis") ! except: ! pass ! try: ! cm = find_working_service(self.gis_peers, 'ClusterManager') ! yield fuse.Direntry("cm") ! except: ! pass return ! if path[:5] != '/gis/' and \ ! path != '/gis' and \ ! path[:4] != '/cm/' and \ ! path != '/cm': return #file("/tmp/gugfsreaddir","a").write("%i 2: proc dir, gis_peers[0]: %s\n" % (self.ncount, self.gis_peers[0])) ! if path[:4] == '/gis': ! try: ! gis = find_working_service(self.gis_peers, 'InformationSystem') ! except: ! return ! services = gis.get() ! if path == "/gis": ! #file("/tmp/gugfsreaddir","a").write("%i 3: proc dir, list services: %i\n" % (self.ncount, len(services))) ! for service in services: ! yield fuse.Direntry(str(service[0]['sid'])) ! return for service in services: ! if path == "/gis/" + service[0]['sid']: ! yield fuse.Direntry('description') ! yield fuse.Direntry('origin') ! yield fuse.Direntry('type') ! yield fuse.Direntry('urls') ! yield fuse.Direntry('timelife') ! yield fuse.Direntry('ttl') ! yield fuse.Direntry('resourcetype') ! return ! ! if path[:3] == '/cm': ! try: ! cm = find_working_service(self.gis_peers, 'ClusterManager') ! except: return + jobs = cm.status('') + if path == "/cm": + #file("/tmp/gugfsreaddir","a").write("%i 3: proc dir, list services: %i\n" % (self.ncount, len(services))) + for job in jobs: + yield fuse.Direntry(str(job[0])) + return + for job in jobs: + if path == '/cm/' + job[0]: + for fname in job[1].keys(): + yield fuse.Direntry(fname) def unlink(self, path): return -errno.EACCES def rmdir(self, path): ! if path[:4] != '/cm/': ! return -errno.EACCES ! fpath = path[4:] ! try: ! cm = find_working_service(self.gis_peers, 'ClusterManager') ! except: ! return -errno.EIO ! jobs = cm.status('') ! for job in jobs: ! if job[0] == fpath: ! cm.delete([fpath]) ! return 0 return -errno.EACCES *************** *** 150,189 **** def open(self, path, flags): accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR ! if path[:5] != "/gis/": return -errno.EACCES if (flags & accmode) != os.O_RDONLY: return -errno.EACCES ! client = get_client(self.gis_peers[0]) ! services = client.get() ! for service in services: ! for fname in ['description', 'origin', 'type', 'urls', 'timelife', 'ttl']: ! if path == "/gis/" + service[0]['sid'] + "/" + fname: ! if self.openfiles.has_key(path): ! self.openfiles[path] += 1 ! else: ! self.openfiles[path] = 1 ! return 0 return -errno.ENOENT def read(self, path, size, offset): ! #file("/tmp/gugfsread", "a").write("%i, 0: %s, offset: %i, size: %i\n" % (self.ncount, path, offset, size)) ! if path[:5] != '/gis/': return -errno.EACCES fcontent = '' ! client = get_client(self.gis_peers[0]) ! services = client.get() ! for service in services: ! for fname in ['description', 'origin', 'type', 'urls', 'timelife', 'ttl']: ! if path == "/gis/" + service[0]['sid'] + "/" + fname: ! #file("/tmp/gugfsread", "a").write("%i, 1: %s\n" % (self.ncount, fname)) if fname == 'description': ! fcontent = service[1] + "\n" elif fname == 'urls': for url in service[0]['urls']: fcontent += url + "\n" else: ! fcontent = service[0][fname] + "\n" ! ! #file("/tmp/gugfsread", "a").write("%i, 2: %s\n" % (self.ncount, fcontent)) slen = len(fcontent) if offset < slen: --- 235,339 ---- def open(self, path, flags): accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR ! if path[:5] != "/gis/" and path[:4] != '/cm/': return -errno.EACCES if (flags & accmode) != os.O_RDONLY: return -errno.EACCES ! ! if path[:5] == '/gis/': ! fpath = path[5:] ! lfpath = len(fpath) ! try: ! gis = find_working_service(self.gis_peers, 'InformationSystem') ! except: ! return -errno.EIO ! services = gis.get() ! for service in services: ! servsid = service[0]['sid'] ! lservsid = len(servsid) ! if servsid + "/" == fpath[:lservsid+1]: ! fname = fpath[lservsid+1:] ! if service[0].has_key(fname): ! if self.openfiles.has_key(path): ! self.openfiles[path] += 1 ! else: ! self.openfiles[path] = 1 ! return 0 ! ! if path[:4] == '/cm/': ! fpath = path[4:] ! lfpath = len(fpath) ! try: ! cm = find_working_service(self.gis_peers, 'ClusterManager') ! except: ! return -errno.EIO ! jobs = cm.status('') ! for job in jobs: ! jobid = job[0] ! ljobid = len(jobid) ! if jobid + "/" == fpath[:ljobid+1]: ! fname = fpath[ljobid+1:] ! if job[1].has_key(fname): ! if self.openfiles.has_key(path): ! self.openfiles[path] += 1 ! else: ! self.openfiles[path] = 1 ! return 0 return -errno.ENOENT def read(self, path, size, offset): ! if path[:5] != '/gis/' and path[:4] != '/cm/': return -errno.EACCES fcontent = '' ! ! if path[:5] == '/gis/': ! fpath = path[5:] ! lfpath = len(fpath) ! try: ! gis = find_working_service(self.gis_peers, 'InformationSystem') ! except: ! return -errno.EIO ! services = gis.get() ! for service in services: ! servsid = service[0]['sid'] ! lservsid = len(servsid) ! if servsid + "/" == fpath[:lservsid+1]: ! fname = fpath[lservsid+1:] if fname == 'description': ! fcontent = service[1] elif fname == 'urls': + fcontent = '' for url in service[0]['urls']: fcontent += url + "\n" + elif fname == 'resourcetype': + fcontent = '' + for res in service[0]['resourcetype']: + fcontent += res + "\n" else: ! fcontent = service[0][fname] ! elif path[:4] == '/cm/': ! fpath = path[4:] ! lfpath = len(fpath) ! try: ! cm = find_working_service(self.gis_peers, 'ClusterManager') ! except: ! return -errno.EIO ! jobs = cm.status('') ! for job in jobs: ! jobid = job[0] ! ljobid = len(jobid) ! if jobid + "/" == fpath[:ljobid+1]: ! fname = fpath[ljobid+1:] ! if fname == 'last_check_time' or fname == 'submit_time': ! fcontent = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime(job[1][fname])) ! elif fname == 'status': ! fcontent = overall_states[job[1][fname]] ! elif fname == 'exit_code': ! if job[1][fname]: ! fcontent = str(job[1][fname]) ! elif job[1].has_key(fname): ! fcontent = str(job[1][fname]) ! else: ! return -errno.ENOENT ! slen = len(fcontent) if offset < slen: *************** *** 193,197 **** else: buf = '' - #file("/tmp/gugfsread", "a").write("%i, 3: %s\n" % (self.ncount, buf)) return buf --- 343,346 ---- *************** *** 200,208 **** def create(self, path, flags, xflags): - #file("/tmp/gugfscreate", "a").write("%i, 0: %s, flags: %s, puff: %s\n" % (self.ncount, path, str(flags), str(xflags))) return -errno.EACCES def flush(self, path): - #file("/tmp/gugfsflush", "a").write("%i, 0: %s\n" % (self.ncount, path)) self.ncount += 1 if self.openfiles.has_key(path): --- 349,355 ---- *************** *** 211,215 **** def release(self, path, flags): - #file("/tmp/gugfsrelease", "a").write("%i, 0: %s, flags: %s\n" % (self.ncount, path, str(flags))) self.ncount += 1 if self.openfiles.has_key(path): --- 358,361 ---- Index: gugfs.py =================================================================== RCS file: /cvsroot/gug/gug/fuse/gugfs.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gugfs.py 22 May 2007 07:14:04 -0000 1.3 --- gugfs.py 24 May 2007 07:13:56 -0000 1.4 *************** *** 8,12 **** from urllib import URLopener ! import os, stat, errno # some spaghetti to make it usable without fuse-py being installed for i in True, False: --- 8,12 ---- from urllib import URLopener ! import os, stat, errno, os.path # some spaghetti to make it usable without fuse-py being installed for i in True, False: *************** *** 62,67 **** self.tempdir += "/" self.tempdir += ".gugfs" ! if not os.access(self.tempdir, 1): ! os.mkdir(self.tempdir, 0700) def getattr(self, path): --- 62,67 ---- self.tempdir += "/" self.tempdir += ".gugfs" ! if not os.path.exists(self.tempdir + "/"): ! os.makedirs(self.tempdir, 0700) def getattr(self, path): |
From: Gergo C. <cs...@us...> - 2007-05-22 07:15:45
|
Update of /cvsroot/gug/gug/gug/service/fss In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6189/service/fss Modified Files: fss.py Log Message: mv/rename facelift Index: fss.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/fss/fss.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** fss.py 25 Jan 2007 20:48:09 -0000 1.12 --- fss.py 22 May 2007 07:15:44 -0000 1.13 *************** *** 394,410 **** # if there is no such entry name in the source directory raise NoSuchEntryException, from_name ! # get the data of the target directory ! to_md, to_ed = self.backend.getDirectory(to_dir) ! if to_ed.has_key(to_name): ! # if the new name is not free ! raise ExistingEntryException, to_name ! # sets the new name ! to_ed[to_name] = from_ed[from_name] ! # removes the old name ! del from_ed[from_name] ! # sets the two directory with the new data back to the catalog ! self.backend.setDirectory(from_dir, from_md, from_ed) ! self.backend.setDirectory(to_dir, to_md, to_ed) ! self.lock.release() except: # release the lock, and reraise the exception --- 394,423 ---- # if there is no such entry name in the source directory raise NoSuchEntryException, from_name ! if to_dir == from_dir: ! # if source and target directory is the same ! if from_ed.has_key(to_name): ! # if the new name is not free ! raise ExistingEntryException, to_name ! # create a new name ! from_ed[to_name] = from_ed[from_name] ! # remove the old name ! del from_ed[from_name] ! # sets the directory with the new data back to the catalog ! self.backend.setDirectory(from_dir, from_md, from_ed) ! self.lock.release() ! else: ! # get the data of the target directory ! to_md, to_ed = self.backend.getDirectory(to_dir) ! if to_ed.has_key(to_name): ! # if the new name is not free ! raise ExistingEntryException, to_name ! # sets the new name ! to_ed[to_name] = from_ed[from_name] ! # removes the old name ! del from_ed[from_name] ! # sets the two directory with the new data back to the catalog ! self.backend.setDirectory(from_dir, from_md, from_ed) ! self.backend.setDirectory(to_dir, to_md, to_ed) ! self.lock.release() except: # release the lock, and reraise the exception |
From: Gergo C. <cs...@us...> - 2007-05-22 07:15:44
|
Update of /cvsroot/gug/gug/gug/client In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6189/client Modified Files: storage.py Log Message: mv/rename facelift Index: storage.py =================================================================== RCS file: /cvsroot/gug/gug/gug/client/storage.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** storage.py 3 Apr 2007 12:37:17 -0000 1.45 --- storage.py 22 May 2007 07:15:44 -0000 1.46 *************** *** 430,442 **** "move from/to local disk not implemented yet" stm = self._stm() ! try: ! stat = stm.stat(target) ! if stat['dirlike']: ! # if exists and is a directory, try to move into it ! target = '/'.join([target, source.split('/')[-1]]) ! else: ! raise ExistingLFNException, target ! except InvalidCatalogEntryException: ! pass if target.startswith(source + '/') or target == source: raise GeneralStorageException, \ --- 430,443 ---- "move from/to local disk not implemented yet" stm = self._stm() ! if stm.exists(target): ! try: ! stat = stm.stat(target) ! if stat['dirlike']: ! # if exists and is a directory, try to move into it ! target = '/'.join([target, source.split('/')[-1]]) ! else: ! raise ExistingLFNException, target ! except InvalidCatalogEntryException: ! pass if target.startswith(source + '/') or target == source: raise GeneralStorageException, \ |
From: Gergo C. <cs...@us...> - 2007-05-22 07:14:08
|
Update of /cvsroot/gug/gug/fuse In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5415 Modified Files: gugfs.py Log Message: mv/rename function Index: gugfs.py =================================================================== RCS file: /cvsroot/gug/gug/fuse/gugfs.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gugfs.py 17 May 2007 09:35:59 -0000 1.2 --- gugfs.py 22 May 2007 07:14:04 -0000 1.3 *************** *** 144,149 **** return 0 ! #def rename(self, path, path1): ! # os.rename("." + path, "." + path1) #def truncate(self, path, len): --- 144,149 ---- return 0 ! def rename(self, path, path1): ! self.storage.mv("/grid" + path, "/grid" + path1) #def truncate(self, path, len): |
From: Nagy Z. <zs...@us...> - 2007-05-21 12:01:49
|
Update of /cvsroot/gug/gug/gug/service In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23551/gug/service Modified Files: testservice.py Log Message: Index: testservice.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/testservice.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** testservice.py 20 Mar 2007 13:14:58 -0000 1.11 --- testservice.py 21 May 2007 12:01:42 -0000 1.12 *************** *** 5,40 **** import time import thread ! ! class ThreadTest: ! ! def __init__(self, id, local_gis_url): ! self.id = id ! self.valami = '' ! ! def csinald(self, cucc, ezt): ! v = self.valami ! time.sleep(3) ! self.valami = v + ezt ! return self.valami ! ! def echo(self, cucc, e): ! return e ! ! def wait(self, cucc, sec): ! uid = mkuid() ! print uid, 'elkezdtem', sec ! k = time.time() ! time.sleep(sec) ! print uid, 'befejeztem', time.time() - k ! return 'jee' ! from gug.common.share import create_provision_task class Echo: """An echo service with extended functionality.""" def __init__(self, initdata): ! self.id = initdata['sid'] ! create_provision_task(initdata, self._get_description, \ ! message_for_logging = 'Echo', ttl = initdata.get('TTL', None)) def echo(self, auth, x): --- 5,17 ---- import time import thread ! from gug.common import log from gug.common.share import create_provision_task + from gug.client.soap import get_client + class Echo: """An echo service with extended functionality.""" def __init__(self, initdata): ! create_provision_task(initdata, self._get_description, message_for_logging = 'Echo') def echo(self, auth, x): *************** *** 43,50 **** echo(x) """ ! # subj = auth['x509'].subject() ! # if subj is not None: ! # subj_str = str(subj) ! return str(auth['x509'].subject()), x def _get_description(self, site_id): --- 20,26 ---- echo(x) """ ! if auth['x509']: ! log.msg(auth['x509'].subject()) ! return x def _get_description(self, site_id): *************** *** 53,78 **** """ ! def wait(self, x509, x): """Waits for x seconds, then returns 'done'. wait(x) """ ! ! if x509: ! log_msg(x509.get_subject()) ! log_msg('I will wait %d seconds' % (x)) import time time.sleep(x) return 'done' ! def error(self, x509): """Generates a division by zero error. error() """ ! if x509: ! log_msg(x509.get_subject()) return 1/0 class TypeChecker: --- 29,87 ---- """ ! def wait(self, auth, x): """Waits for x seconds, then returns 'done'. wait(x) """ ! if auth['x509']: ! log.msg(auth['x509'].subject()) ! log.msg('I will wait %d seconds' % x) import time time.sleep(x) return 'done' ! def error(self, auth): """Generates a division by zero error. error() """ ! if auth['x509']: ! log.msg(auth['x509'].subject()) return 1/0 + def far_echo(self, auth, x): + if auth['x509']: + log.msg(auth['x509'].subject()) + log.msg('I will call myself') + g = get_client('https://localhost:21112/Echo') + log.msg(g) + return g.echo(x) + + # -------------------------------------------- + + class ThreadTest: + + def __init__(self, id, local_gis_url): + self.id = id + self.valami = '' + + def csinald(self, cucc, ezt): + v = self.valami + time.sleep(3) + self.valami = v + ezt + return self.valami + + def echo(self, cucc, e): + return e + + def wait(self, cucc, sec): + uid = mkuid() + print uid, 'elkezdtem', sec + k = time.time() + time.sleep(sec) + print uid, 'befejeztem', time.time() - k + return 'jee' + + class TypeChecker: |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:04
|
Update of /cvsroot/gug/gug/fuse In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/fuse Modified Files: gugfs.py Added Files: gugprocfs.py Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq --- NEW FILE: gugprocfs.py --- #!/usr/bin/env python from gug.common.config import Config, ConfigMem, find_config_file from gug.client.soap import find_working_service, get_client_by_id, get_client from gug.client.storage import Storage from gug.common.exception import * from gug.common.share import random_name from urllib import URLopener import os, stat, errno # some spaghetti to make it usable without fuse-py being installed for i in True, False: try: import fuse from fuse import Fuse except ImportError: if i: try: import _find_fuse_parts except ImportError: pass else: raise if not hasattr(fuse, '__version__'): raise RuntimeError, \ "your fuse-py doesn't know of fuse.__version__, probably it's too old." # This setting is optional, but it ensures that this class will keep # working after a future API revision fuse.fuse_python_api = (0, 2) class MyStat(fuse.Stat): def __init__(self): self.st_mode = 0 self.st_ino = 0 self.st_dev = 0 self.st_nlink = 0 self.st_uid = 0 self.st_gid = 0 self.st_size = 0 self.st_atime = 0 self.st_mtime = 0 self.st_ctime = 0 class GugFS(Fuse): def __init__(self, *args, **kw): Fuse.__init__(self, *args, **kw) self.openfiles = {} self.ncount = 0 def gisinit(self): config = Config(self.cmdline[0].clientconf) self.gis_peers = config.get_content("/ClientConfig/GISPeers/GIS") #file("/tmp/gugfsgis", "w").write(str(self.gis_peers)) self.storage = Storage(self.gis_peers, False) def getattr(self, path): #file("/tmp/gugfsgetattr_proc", "a").write("%i 1: %s\n" % (self.ncount, path)) st = MyStat() if path == '/' or path == '/gis': st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 return st if path[:5] != '/gis/': return -errno.ENOENT fpath = path[5:] lfpath = len(fpath) client = get_client(self.gis_peers[0]) services = client.get() for service in services: servsid = service[0]['sid'] if servsid == fpath: st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 return st else: lservsid = len(servsid) if servsid + "/" == fpath[:lservsid+1]: st.st_mode = stat.S_IFREG | 0444 st.st_nlink = 1 fname = fpath[lservsid+1:] if fname == 'description': st.st_size = len(service[1]) elif fname == 'urls': urls = '' for url in service[0]['urls']: urls += url + "\n" st.st_size = len(urls) else: st.st_size = len(service[0][fname]) return st return None def readdir(self, path, offset): #file("/tmp/gugfsreaddir","a").write("%i %s\n" % (self.ncount, path)) yield fuse.Direntry(".") yield fuse.Direntry("..") if path == '/': yield fuse.Direntry("gis") return if path[:5] != '/gis/' and path != '/gis': return #file("/tmp/gugfsreaddir","a").write("%i 2: proc dir, gis_peers[0]: %s\n" % (self.ncount, self.gis_peers[0])) client = get_client(self.gis_peers[0]) print "client: " + str(client) services = client.get() if path == "/gis": #file("/tmp/gugfsreaddir","a").write("%i 3: proc dir, list services: %i\n" % (self.ncount, len(services))) for service in services: yield fuse.Direntry(str(service[0]['sid'])) return for service in services: if path == "/gis/" + service[0]['sid']: yield fuse.Direntry('description') yield fuse.Direntry('origin') yield fuse.Direntry('type') yield fuse.Direntry('urls') yield fuse.Direntry('timelife') yield fuse.Direntry('ttl') return def unlink(self, path): #file("/tmp/gugfsunlink", "a").write("%i %s\n" % (self.ncount, path)) return -errno.EACCES def rmdir(self, path): #file("/tmp/gugfsrmdir", "a").write("%i %s\n" % (self.ncount, path)) return -errno.EACCES def rename(self, path, path1): return -errno.EACCES def truncate(self, path, len): return -errno.EACCES def mkdir(self, path, mode): return -errno.EACCES def open(self, path, flags): accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR if path[:5] != "/gis/": return -errno.EACCES if (flags & accmode) != os.O_RDONLY: return -errno.EACCES client = get_client(self.gis_peers[0]) services = client.get() for service in services: for fname in ['description', 'origin', 'type', 'urls', 'timelife', 'ttl']: if path == "/gis/" + service[0]['sid'] + "/" + fname: if self.openfiles.has_key(path): self.openfiles[path] += 1 else: self.openfiles[path] = 1 return 0 return -errno.ENOENT def read(self, path, size, offset): #file("/tmp/gugfsread", "a").write("%i, 0: %s, offset: %i, size: %i\n" % (self.ncount, path, offset, size)) if path[:5] != '/gis/': return -errno.EACCES fcontent = '' client = get_client(self.gis_peers[0]) services = client.get() for service in services: for fname in ['description', 'origin', 'type', 'urls', 'timelife', 'ttl']: if path == "/gis/" + service[0]['sid'] + "/" + fname: #file("/tmp/gugfsread", "a").write("%i, 1: %s\n" % (self.ncount, fname)) if fname == 'description': fcontent = service[1] + "\n" elif fname == 'urls': for url in service[0]['urls']: fcontent += url + "\n" else: fcontent = service[0][fname] + "\n" #file("/tmp/gugfsread", "a").write("%i, 2: %s\n" % (self.ncount, fcontent)) slen = len(fcontent) if offset < slen: if offset + size > slen: size = slen - offset buf = str(fcontent[offset:offset+size]) else: buf = '' #file("/tmp/gugfsread", "a").write("%i, 3: %s\n" % (self.ncount, buf)) return buf def write(self, path, buf, offset): return -errno.EACCES def create(self, path, flags, xflags): #file("/tmp/gugfscreate", "a").write("%i, 0: %s, flags: %s, puff: %s\n" % (self.ncount, path, str(flags), str(xflags))) return -errno.EACCES def flush(self, path): #file("/tmp/gugfsflush", "a").write("%i, 0: %s\n" % (self.ncount, path)) self.ncount += 1 if self.openfiles.has_key(path): return 0 return -errno.ENOENT def release(self, path, flags): #file("/tmp/gugfsrelease", "a").write("%i, 0: %s, flags: %s\n" % (self.ncount, path, str(flags))) self.ncount += 1 if self.openfiles.has_key(path): self.openfiles[path] -= 1 if self.openfiles[path] == 0: del self.openfiles[path] return 0 return -errno.ENOENT def statfs(self): sfs = fuse.StatVfs() sfs.f_bsize = 0 sfs.f_frsize = 0 sfs.f_blocks = 0 sfs.f_bfree = 0 sfs.f_bavail = 0 return sfs def main(): usage=""" Userspace GUG proc filesystem """ + Fuse.fusage server = GugFS(version="%prog " + fuse.__version__, usage=usage, dash_s_do='setsingle') cfgfile = find_config_file("client.conf") server.parser.add_option(mountopt="clientconf", metavar="PATH", default=cfgfile, help="Path of GUG Client config file [default: %default]") server.parse(errex=1) server.gisinit() server.main() if __name__ == '__main__': main() Index: gugfs.py =================================================================== RCS file: /cvsroot/gug/gug/fuse/gugfs.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gugfs.py 14 May 2007 08:18:48 -0000 1.1 --- gugfs.py 17 May 2007 09:35:59 -0000 1.2 *************** *** 1,7 **** #!/usr/bin/env python ! from gug.common.config import Config, find_config_file from gug.client.storage import Storage from gug.common.exception import * import os, stat, errno --- 1,10 ---- #!/usr/bin/env python ! from gug.common.config import Config, ConfigMem, find_config_file ! from gug.client.soap import find_working_service, get_client_by_id, get_client from gug.client.storage import Storage from gug.common.exception import * + from gug.common.share import random_name + from urllib import URLopener import os, stat, errno *************** *** 46,68 **** def __init__(self, *args, **kw): Fuse.__init__(self, *args, **kw) self.ncount = 0 def gisinit(self): config = Config(self.cmdline[0].clientconf) ! gis_peers = config.get_content("/ClientConfig/GISPeers/GIS") ! file("/tmp/gugfsgis", "w").write(str(gis_peers)) ! self.storage = Storage(gis_peers, False) def getattr(self, path): ! file("/tmp/gugfsgetattr", "a").write("%i %s\n" % (self.ncount, path)) st = MyStat() if path == '/': st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 else: ! file("/tmp/gugfsgetattr", "a").write("4: %i, %s\n" % (self.ncount, path)) xsts = self.storage.exists('/grid' + path) ! file("/tmp/gugfsgetattr", "a").write("5: %i, %s\n" % (self.ncount, str(xsts))) if not xsts: return -errno.ENOENT --- 49,85 ---- def __init__(self, *args, **kw): Fuse.__init__(self, *args, **kw) + self.created = {} + self.openfiles = {} self.ncount = 0 def gisinit(self): config = Config(self.cmdline[0].clientconf) ! self.gis_peers = config.get_content("/ClientConfig/GISPeers/GIS") ! #file("/tmp/gugfsgis", "w").write(str(self.gis_peers)) ! self.storage = Storage(self.gis_peers, False) ! self.tempdir = self.cmdline[0].tempdir ! if self.tempdir[-1:] != "/": ! self.tempdir += "/" ! self.tempdir += ".gugfs" ! if not os.access(self.tempdir, 1): ! os.mkdir(self.tempdir, 0700) def getattr(self, path): ! #file("/tmp/gugfsgetattr", "a").write("%i %s\n" % (self.ncount, path)) ! st = MyStat() + if self.created.has_key(path): + st.st_mode = stat.S_IFREG | 0666 + st.st_nlink = 1 + st.st_size = self.created[path]['size'] + return st if path == '/': st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 else: ! #file("/tmp/gugfsgetattr", "a").write("4: %i, %s\n" % (self.ncount, path)) xsts = self.storage.exists('/grid' + path) ! #file("/tmp/gugfsgetattr", "a").write("5: %i, %s\n" % (self.ncount, str(xsts))) if not xsts: return -errno.ENOENT *************** *** 70,79 **** try: gugstat = self.storage.stat('/grid' + path) ! file("/tmp/gugfsgetattr", "a").write("6: %i %s\n" % (self.ncount, path)) except e: ! file("/tmp/gugfsgetattr", "a").write("7: %i %s\n" % (self.ncount, path) + "exception: " + str(e) + "\n") return -errno.ENOENT ! file("/tmp/gugfsgetattr", "a").write("8: %i %s\n" % (self.ncount, path) + "gugstat: " + str(gugstat) + "\n") st.st_mtime = int(gugstat['created']) st.st_ctime = int(gugstat['created']) --- 87,96 ---- try: gugstat = self.storage.stat('/grid' + path) ! #file("/tmp/gugfsgetattr", "a").write("6: %i %s\n" % (self.ncount, path)) except e: ! #file("/tmp/gugfsgetattr", "a").write("7: %i %s\n" % (self.ncount, path) + "exception: " + str(e) + "\n") return -errno.ENOENT ! #file("/tmp/gugfsgetattr", "a").write("8: %i %s\n" % (self.ncount, path) + "gugstat: " + str(gugstat) + "\n") st.st_mtime = int(gugstat['created']) st.st_ctime = int(gugstat['created']) *************** *** 88,95 **** return st - def readdir(self, path, offset): ! file("/tmp/gugfsreaddir","a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 try: lfn = self.storage.glob("/grid" + path) --- 105,115 ---- return st def readdir(self, path, offset): ! #file("/tmp/gugfsreaddir","a").write("%i %s\n" % (self.ncount, path)) ! self.ncount += 1 + yield fuse.Direntry(".") + yield fuse.Direntry("..") + try: lfn = self.storage.glob("/grid" + path) *************** *** 99,105 **** return - yield fuse.Direntry(".") - yield fuse.Direntry("..") - dirlen = len("/grid" + path) if path[-1:] != "/": --- 119,122 ---- *************** *** 109,127 **** fnam = line['lfn'][dirlen:] if line['dirlike']: ! file("/tmp/gugfsreaddir","a").write("dirlike: %s\n" % (str(fnam))) yield fuse.Direntry(str(fnam)) else: ! file("/tmp/gugfsreaddir","a").write("filelike: %s\n" % (str(fnam))) yield fuse.Direntry(str(fnam)) def unlink(self, path): ! file("/tmp/gugfsunlink", "a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 self.storage.rm("/grid" + path) def rmdir(self, path): ! file("/tmp/gugfsrmdir", "a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 self.storage.rmdir("/grid" + path) #def rename(self, path, path1): --- 126,146 ---- fnam = line['lfn'][dirlen:] if line['dirlike']: ! #file("/tmp/gugfsreaddir","a").write("dirlike: %s\n" % (str(fnam))) yield fuse.Direntry(str(fnam)) else: ! #file("/tmp/gugfsreaddir","a").write("filelike: %s\n" % (str(fnam))) yield fuse.Direntry(str(fnam)) def unlink(self, path): ! #file("/tmp/gugfsunlink", "a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 self.storage.rm("/grid" + path) + return 0 def rmdir(self, path): ! #file("/tmp/gugfsrmdir", "a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 self.storage.rmdir("/grid" + path) + return 0 #def rename(self, path, path1): *************** *** 134,145 **** def mkdir(self, path, mode): ! file("/tmp/gugfsmkdir", "a").write("%i %s\n" % (self.ncount, path)) try: self.storage.mkdir("/grid" + path) except e: ! file("/tmp/gugfsmkdir", "a").write("%i %s\n" % (self.ncount, str(e))) self.ncount += 1 def main(): --- 153,309 ---- def mkdir(self, path, mode): ! #file("/tmp/gugfsmkdir", "a").write("%i %s\n" % (self.ncount, path)) try: self.storage.mkdir("/grid" + path) except e: ! #file("/tmp/gugfsmkdir", "a").write("%i %s\n" % (self.ncount, str(e))) ! pass ! self.ncount += 1 ! return 0 ! ! def open(self, path, flags): ! accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR ! xsts = self.storage.exists('/grid' + path) ! #file("/tmp/gugfsopen", "a").write("%i, %s exists: %s, flags: %s\n" % (self.ncount, path, str(xsts), str(flags))) ! self.ncount += 1 ! if not xsts: ! return -errno.ENOENT ! if self.created.has_key(path): ! return -errno.EACCES ! if (flags & accmode) != os.O_RDONLY: ! return -errno.EACCES ! if self.openfiles.has_key(path): ! self.openfiles[path] += 1 ! else: ! self.openfiles[path] = 1 ! return 0 ! ! def read(self, path, size, offset): ! #file("/tmp/gugfsread", "a").write("%i, 0: %s, offset: %i, size: %i\n" % (self.ncount, path, offset, size)) ! ! xsts = self.storage.exists('/grid' + path) ! #file("/tmp/gugfsread", "a").write("%i, 1: %s exists: %s\n" % (self.ncount, path, str(xsts))) ! if not xsts: ! return -errno.ENOENT ! ! #meret file meret lekerdezese ! gugstat = self.storage.stat('/grid' + path) ! flen = int(gugstat['size']) ! if offset > flen: ! return -errno.ENOENT ! ! if offset + size > flen: ! size = flen - offset ! ! #FSS keresese ! fss = find_working_service(self.gis_peers, 'FileSystemService') ! #file("/tmp/gugfsread", "a").write("%i, 2: fss: %s\n" % (self.ncount, str(fss))) ! ! #SURL lekerdezese ! lfn_data = fss.traverseLFN('/grid' + path) ! #file("/tmp/gugfsread", "a").write("%i, 3: lfn_data: %s\n" % (self.ncount, str(lfn_data))) ! ! #SURL kivetele az xml file-bol ! xmlcfg = ConfigMem(lfn_data['data']) ! surl = xmlcfg.get_content('/File/SURL') ! #file("/tmp/gugfsread", "a").write("%i, 4: surl: %s\n" % (self.ncount, str(surl))) ! ! #STC keresese ! stcname = surl[0].split('/')[0] ! stc = get_client_by_id(self.gis_peers, stcname) ! #file("/tmp/gugfsread", "a").write("%i, 5: stc: %s\n" % (self.ncount, str(stc))) ! ! #TURL lekerdezese ! turl = stc.prepareToGet(surl, offset, size)['files'][0]['turls'][0] ! #file("/tmp/gugfsread", "a").write("%i, 6: turl: %s\n" % (self.ncount, str(turl))) ! ! #File lekerese ! try: ! tfile = URLopener().open(turl) ! except e: ! file("/tmp/gugfsread", "a").write("%i, 61: exception: %s\n" % (self.ncount, str(e))) ! #file("/tmp/gugfsread", "a").write("%i, 7: tfile: %s\n" % (self.ncount, str(tfile))) ! buf = tfile.read() ! #file("/tmp/gugfsread", "a").write("%i, 8: buf: %s\n" % (self.ncount, str(fss))) ! self.ncount += 1 + return buf + def write(self, path, buf, offset): + #file("/tmp/gugfswrite", "a").write("%i, 0: %s offset: %i, size: %i\n" % (self.ncount, path, offset, len(buf))) + if not self.created.has_key(path): + return -errno.ENOENT + self.created[path]['file'].write(buf) + self.created[path]['writed'] += len(buf) + self.ncount += 1 + return len(buf) + def create(self, path, flags, xflags): + #file("/tmp/gugfscreate", "a").write("%i, 0: %s, flags: %s, puff: %s\n" % (self.ncount, path, str(flags), str(xflags))) + xsts = self.storage.exists('/grid' + path) + if xsts: + return -errno.EACCES + self.ncount += 1 + if self.created.has_key(path): + return -errno.EACCES + tmpname = random_name() + while os.access(self.tempdir + "/" + tmpname, 0): + tmpname = random_name() + tmpname = self.tempdir + "/" + tmpname + f = file(tmpname, "wb") + self.created[path] = {'size' : 0, 'tempfile': tmpname, 'file': f, 'writed': 0} + return 0 + + def flush(self, path): + #file("/tmp/gugfsflush", "a").write("%i, 0: %s\n" % (self.ncount, path)) + self.ncount += 1 + if self.created.has_key(path): + self.created[path]['file'].flush() + self.created[path]['size'] += self.created[path]['writed'] + self.created[path]['writed'] = 0 + return 0 + elif self.openfiles.has_key(path): + return 0 + elif self.storage.exists('/grid' + path): + return 0 + return -errno.ENOENT + + def release(self, path, flags): + #file("/tmp/gugfsrelease", "a").write("%i, 0: %s, flags: %s\n" % (self.ncount, path, str(flags))) + self.ncount += 1 + if self.created.has_key(path): + self.created[path]['file'].close() + self.storage.put(self.created[path]['tempfile'], "/grid" + path) + os.unlink(self.created[path]['tempfile']) + del self.created[path] + return 0 + elif self.openfiles.has_key(path): + self.openfiles[path] -= 1 + if self.openfiles[path] == 0: + del self.openfiles[path] + return 0 + elif self.storage.exists('/grid' + path): + return 0 + return -errno.ENOENT + + def statfs(self): + sfs = fuse.StatVfs() + client = get_client(self.gis_peers[0]) + services = client.get() + fstotal = 0 + fsfree = 0 + for service in services: + if service[0]['type'] == 'StorageController': + stconf = ConfigMem(service[1]) + dstotal = stconf.get_content("/ServiceDescription/StorageElement/DataStorageTotal") + dsfree = stconf.get_content("/ServiceDescription/StorageElement/DataStorageFree") + fstotal += (int(dstotal[0]) / 512) + fsfree += (int(dsfree[0]) / 512) + sfs.f_bsize = 512 + sfs.f_frsize = 512 + sfs.f_blocks = fstotal + sfs.f_bfree = fsfree + sfs.f_bavail = fsfree + return sfs def main(): *************** *** 157,160 **** --- 321,328 ---- default=cfgfile, help="Path of GUG Client config file [default: %default]") + server.parser.add_option(mountopt="tempdir", + metavar="PATH", + default="/tmp", + help="Path of temp dir, where created, but not closed files there [default: %default]") server.parse(errex=1) server.gisinit() |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:04
|
Update of /cvsroot/gug/gug/gug/service/stc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/gug/service/stc Modified Files: stc.py Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq Index: stc.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/stc/stc.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** stc.py 3 Apr 2007 12:50:21 -0000 1.42 --- stc.py 17 May 2007 09:36:00 -0000 1.43 *************** *** 48,52 **** if data['status'] == 'request_prepared': print 'Creating handler for prepared request %s.%s' % (token, id) ! self._create_handler(data['type'],data['path'], token, id) def _dict_to_file(self, d, fn): --- 48,52 ---- if data['status'] == 'request_prepared': print 'Creating handler for prepared request %s.%s' % (token, id) ! self._create_handler(data['type'],data['path'], token, id, data['offset'], data['size']) def _dict_to_file(self, d, fn): *************** *** 282,286 **** return [self._get_all_data(token) for token in self._get_tokens()] ! def _create_handler(self, type, filename, token, id): # create the location from token and id locations = self._locations(token, id) --- 282,286 ---- return [self._get_all_data(token) for token in self._get_tokens()] ! def _create_handler(self, type, filename, token, id, offset=-1, size=-1): # create the location from token and id locations = self._locations(token, id) *************** *** 292,296 **** handler = hclass(filename, \ self._lambda_unregister(token, id), \ ! self._lambda_alter_status(token, id)) # add the new handle to HTTPServer for location in locations: --- 292,296 ---- handler = hclass(filename, \ self._lambda_unregister(token, id), \ ! self._lambda_alter_status(token, id), offset, size) # add the new handle to HTTPServer for location in locations: *************** *** 305,309 **** return turls ! def prepareToGet(self, auth, surls): """Prepare to get files identified by SURLs. --- 305,309 ---- return turls ! def prepareToGet(self, auth, surls, offset=-1, size=-1): """Prepare to get files identified by SURLs. *************** *** 324,328 **** # if it is a real file # create a new handler for HTTPServer which will serve the download ! locations = self._create_handler('get',filename, token, id) # create a TURL turls = self._turls(locations) --- 324,328 ---- # if it is a real file # create a new handler for HTTPServer which will serve the download ! locations = self._create_handler('get',filename, token, id, offset, size) # create a TURL turls = self._turls(locations) *************** *** 332,336 **** turls = [] statuscode = 'invalid_path' ! data = {'status': statuscode, 'surl': surl, 'turls': turls, 'type' : 'get'} # save request data to file self._create_request_file(token, id, data) --- 332,336 ---- turls = [] statuscode = 'invalid_path' ! data = {'status': statuscode, 'surl': surl, 'turls': turls, 'type' : 'get', 'offset' : offset, 'size' : size} # save request data to file self._create_request_file(token, id, data) |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:03
|
Update of /cvsroot/gug/gug/gug/host In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/gug/host Added Files: .cvsignore Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq --- NEW FILE: .cvsignore --- *.pyc |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:03
|
Update of /cvsroot/gug/gug/gug/service/manager In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/gug/service/manager Added Files: .cvsignore Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq --- NEW FILE: .cvsignore --- *.pyc |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:03
|
Update of /cvsroot/gug/gug/gug/common/sysinfo In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/gug/common/sysinfo Added Files: .cvsignore Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq --- NEW FILE: .cvsignore --- *.pyc |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:03
|
Update of /cvsroot/gug/gug/gug/service/cm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/gug/service/cm Added Files: .cvsignore Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq --- NEW FILE: .cvsignore --- *.pyc |
From: Gergo C. <cs...@us...> - 2007-05-17 09:36:02
|
Update of /cvsroot/gug/gug/gug/host/handler In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31048/gug/host/handler Modified Files: turl.py Log Message: gugfs 0.0.1b, gugprocfs 0.0.1b and some .cvsignore wq Index: turl.py =================================================================== RCS file: /cvsroot/gug/gug/gug/host/handler/turl.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** turl.py 19 Feb 2007 12:53:29 -0000 1.6 --- turl.py 17 May 2007 09:35:59 -0000 1.7 *************** *** 7,11 **** class PUTHandler: ! def __init__(self, filename, unregister_method, alter_status_method): print 'PUTHandler is initializing with', filename self.active = True --- 7,11 ---- class PUTHandler: ! def __init__(self, filename, unregister_method, alter_status_method, offset=-1, size=-1): print 'PUTHandler is initializing with', filename self.active = True *************** *** 61,66 **** class GETHandler: ! def __init__(self, filename, unregister_method, alter_status_method): self.filename = filename self.active = True self.unregister = unregister_method --- 61,68 ---- class GETHandler: ! def __init__(self, filename, unregister_method, alter_status_method, offset=-1, size=-1): self.filename = filename + self.offset = offset + self.size = size self.active = True self.unregister = unregister_method *************** *** 84,90 **** print 'serving GET', self.filename length = os.path.getsize(self.filename) request.send_response(200) request.send_header('Content-type', 'application/octet-stream') ! request.send_header('Content-Length', str(length)) request.end_headers() pos = 0 --- 86,101 ---- print 'serving GET', self.filename length = os.path.getsize(self.filename) + if self.offset != -1 and self.size != -1: + if self.offset > length: + self.lock.release() + raise HandlerError, 'Offset error.\n' + if self.offset + self.size > length: + self.lock.release() + raise HandlerError, 'Size error.\n' + f.seek(self.offset) + length = self.size request.send_response(200) request.send_header('Content-type', 'application/octet-stream') ! request.send_header('Content-Length', str(length)) request.end_headers() pos = 0 *************** *** 103,105 **** log.error() self.alter_status('aborted') - --- 114,115 ---- |
From: Gergo C. <cs...@us...> - 2007-05-14 08:50:55
|
Update of /cvsroot/gug/gug/etc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv28058 Modified Files: site.conf.default Log Message: bugfix Index: site.conf.default =================================================================== RCS file: /cvsroot/gug/gug/etc/site.conf.default,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** site.conf.default 14 May 2007 08:18:48 -0000 1.49 --- site.conf.default 14 May 2007 08:50:55 -0000 1.50 *************** *** 16,20 **** <Network> <Insecure>21111</Insecure> ! <Insecure>21112</Insecure> <Insecure>21113</Insecure> <!-- This port is for the file transfers of StC --> <Certificate> --- 16,20 ---- <Network> <Insecure>21111</Insecure> ! <Secure>21112</Secure> <Insecure>21113</Insecure> <!-- This port is for the file transfers of StC --> <Certificate> |
From: Gergo C. <cs...@us...> - 2007-05-14 08:18:49
|
Update of /cvsroot/gug/gug/fuse In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15993/fuse Added Files: gugfs.py Log Message: Test implementation of gugfs-fuse --- NEW FILE: gugfs.py --- #!/usr/bin/env python from gug.common.config import Config, find_config_file from gug.client.storage import Storage from gug.common.exception import * import os, stat, errno # some spaghetti to make it usable without fuse-py being installed for i in True, False: try: import fuse from fuse import Fuse except ImportError: if i: try: import _find_fuse_parts except ImportError: pass else: raise if not hasattr(fuse, '__version__'): raise RuntimeError, \ "your fuse-py doesn't know of fuse.__version__, probably it's too old." # This setting is optional, but it ensures that this class will keep # working after a future API revision fuse.fuse_python_api = (0, 2) class MyStat(fuse.Stat): def __init__(self): self.st_mode = 0 self.st_ino = 0 self.st_dev = 0 self.st_nlink = 0 self.st_uid = 0 self.st_gid = 0 self.st_size = 0 self.st_atime = 0 self.st_mtime = 0 self.st_ctime = 0 class GugFS(Fuse): def __init__(self, *args, **kw): Fuse.__init__(self, *args, **kw) self.ncount = 0 def gisinit(self): config = Config(self.cmdline[0].clientconf) gis_peers = config.get_content("/ClientConfig/GISPeers/GIS") file("/tmp/gugfsgis", "w").write(str(gis_peers)) self.storage = Storage(gis_peers, False) def getattr(self, path): file("/tmp/gugfsgetattr", "a").write("%i %s\n" % (self.ncount, path)) st = MyStat() if path == '/': st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 2 else: file("/tmp/gugfsgetattr", "a").write("4: %i, %s\n" % (self.ncount, path)) xsts = self.storage.exists('/grid' + path) file("/tmp/gugfsgetattr", "a").write("5: %i, %s\n" % (self.ncount, str(xsts))) if not xsts: return -errno.ENOENT try: gugstat = self.storage.stat('/grid' + path) file("/tmp/gugfsgetattr", "a").write("6: %i %s\n" % (self.ncount, path)) except e: file("/tmp/gugfsgetattr", "a").write("7: %i %s\n" % (self.ncount, path) + "exception: " + str(e) + "\n") return -errno.ENOENT file("/tmp/gugfsgetattr", "a").write("8: %i %s\n" % (self.ncount, path) + "gugstat: " + str(gugstat) + "\n") st.st_mtime = int(gugstat['created']) st.st_ctime = int(gugstat['created']) if gugstat['dirlike']: st.st_mode = stat.S_IFDIR | 0755 st.st_nlink = 1 else: st.st_mode = stat.S_IFREG | 0444 st.st_nlink = 1 st.st_size = int(gugstat['size']) self.ncount += 1 return st def readdir(self, path, offset): file("/tmp/gugfsreaddir","a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 try: lfn = self.storage.glob("/grid" + path) except LFNNotFoundException, lfn: return except InvalidLFNException, lfn: return yield fuse.Direntry(".") yield fuse.Direntry("..") dirlen = len("/grid" + path) if path[-1:] != "/": dirlen += 1 for dir, lines in self.storage.ls("/grid" + path, False): for line in lines: fnam = line['lfn'][dirlen:] if line['dirlike']: file("/tmp/gugfsreaddir","a").write("dirlike: %s\n" % (str(fnam))) yield fuse.Direntry(str(fnam)) else: file("/tmp/gugfsreaddir","a").write("filelike: %s\n" % (str(fnam))) yield fuse.Direntry(str(fnam)) def unlink(self, path): file("/tmp/gugfsunlink", "a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 self.storage.rm("/grid" + path) def rmdir(self, path): file("/tmp/gugfsrmdir", "a").write("%i %s\n" % (self.ncount, path)) self.ncount += 1 self.storage.rmdir("/grid" + path) #def rename(self, path, path1): # os.rename("." + path, "." + path1) #def truncate(self, path, len): # f = open("." + path, "a") # f.truncate(len) # f.close() def mkdir(self, path, mode): file("/tmp/gugfsmkdir", "a").write("%i %s\n" % (self.ncount, path)) try: self.storage.mkdir("/grid" + path) except e: file("/tmp/gugfsmkdir", "a").write("%i %s\n" % (self.ncount, str(e))) self.ncount += 1 def main(): usage=""" Userspace GUG filesystem """ + Fuse.fusage server = GugFS(version="%prog " + fuse.__version__, usage=usage, dash_s_do='setsingle') cfgfile = find_config_file("client.conf") server.parser.add_option(mountopt="clientconf", metavar="PATH", default=cfgfile, help="Path of GUG Client config file [default: %default]") server.parse(errex=1) server.gisinit() server.main() if __name__ == '__main__': main() |
From: Gergo C. <cs...@us...> - 2007-05-14 08:18:49
|
Update of /cvsroot/gug/gug/etc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15993/etc Modified Files: site.conf.default Log Message: Test implementation of gugfs-fuse Index: site.conf.default =================================================================== RCS file: /cvsroot/gug/gug/etc/site.conf.default,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** site.conf.default 22 Apr 2007 23:41:54 -0000 1.48 --- site.conf.default 14 May 2007 08:18:48 -0000 1.49 *************** *** 16,20 **** <Network> <Insecure>21111</Insecure> ! <Secure>21112</Secure> <Insecure>21113</Insecure> <!-- This port is for the file transfers of StC --> <Certificate> --- 16,20 ---- <Network> <Insecure>21111</Insecure> ! <Insecure>21112</Insecure> <Insecure>21113</Insecure> <!-- This port is for the file transfers of StC --> <Certificate> |
From: Gergo C. <cs...@us...> - 2007-05-14 08:17:43
|
Update of /cvsroot/gug/gug/fuse In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15614/fuse Log Message: Directory /cvsroot/gug/gug/fuse added to the repository |
From: Roczei G. <ro...@us...> - 2007-05-13 22:13:56
|
Update of /cvsroot/gug/gug/gug/service/cm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13846 Modified Files: cm.py Log Message: bugfix Index: cm.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/cm/cm.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** cm.py 13 May 2007 21:53:59 -0000 1.40 --- cm.py 13 May 2007 22:13:56 -0000 1.41 *************** *** 248,251 **** --- 248,254 ---- log.msg('I cannot repair this job: %s, reason: %s' % (item['grid_id'], error)) item['status'] = BES_OVERALL_STATE_NEW + except: + log.error() + item['status'] = BES_OVERALL_STATE_NEW if result == False: |
From: Roczei G. <ro...@us...> - 2007-05-13 21:55:37
|
Update of /cvsroot/gug/gug/gug/service/jc/lrms In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6886 Modified Files: cm.py Log Message: bugfix Index: cm.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/jc/lrms/cm.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** cm.py 30 Apr 2007 20:24:01 -0000 1.17 --- cm.py 13 May 2007 21:55:36 -0000 1.18 *************** *** 7,11 **** from gug.common.ogsa_bes import * from gug.common.share import mkuid, import_class_from_string, gis_proxy, create_provision_task ! from gug.host.timed import Task import os --- 7,12 ---- from gug.common.ogsa_bes import * from gug.common.share import mkuid, import_class_from_string, gis_proxy, create_provision_task ! from gug.host.timed import Task ! import time import os *************** *** 38,42 **** def reject(self, jsdl_doc, new_jobs = 0): if self.cm is None: ! print 'i have no Cluster Manager, rejection' return True free_cpu = int(dict(self.cm.info())['sum']['free_cpu']) --- 39,43 ---- def reject(self, jsdl_doc, new_jobs = 0): if self.cm is None: ! print 'I have not any Cluster Managers, rejection' return True free_cpu = int(dict(self.cm.info())['sum']['free_cpu']) *************** *** 78,87 **** def status(self, lrms_id): ! st = self.cm.status([lrms_id])[0] ret = {'grid_id' : st[0], 'status' : st[1]['status'], 'error_message' : st[1]['error_message']} print ret return ret - def get_ce_data(self): if self.cm is None: --- 79,94 ---- def status(self, lrms_id): ! while True: ! try: ! st = self.cm.status([lrms_id])[0] ! break ! except: ! time.sleep(1) ! continue ! ret = {'grid_id' : st[0], 'status' : st[1]['status'], 'error_message' : st[1]['error_message']} print ret return ret def get_ce_data(self): if self.cm is None: |
From: Roczei G. <ro...@us...> - 2007-05-13 21:54:28
|
Update of /cvsroot/gug/gug/gug/service/exec In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6499 Modified Files: exec.py Log Message: bugfix Index: exec.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/exec/exec.py,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** exec.py 7 May 2007 13:27:26 -0000 1.54 --- exec.py 13 May 2007 21:54:28 -0000 1.55 *************** *** 142,145 **** --- 142,149 ---- except: log.error() + + while proc == None: + time.sleep(1) + self.my_exec.pool[self.poolid].proc = proc *************** *** 148,153 **** try: self.execute(self.poolid) - while self.my_exec.pool[self.poolid].proc == None: - time.sleep(1) pid = self.my_exec.pool[self.poolid].pid = self.my_exec.pool[self.poolid].proc.pid --- 152,155 ---- *************** *** 162,173 **** self.my_exec.pool[self.poolid].stop and not \ self.my_exec.pool[self.poolid].suspend: ! log.error('Job TERMINATED: %s' % self.poolid) elif self.my_exec.pool[self.poolid].stop and not \ self.my_exec.pool[self.poolid].suspend: ! log.msg('Job STOPPED: %s' % self.poolid) elif self.my_exec.pool[self.poolid].suspend: log.msg('Job SUSPENDED: %s' % self.poolid) else: ! log.msg('Job is DONE: %s exit code:' % self.poolid, self.my_exec.pool[self.poolid].exit_code) class ProcessStatus: --- 164,175 ---- self.my_exec.pool[self.poolid].stop and not \ self.my_exec.pool[self.poolid].suspend: ! log.error('Job FAILED: %s' % self.poolid) elif self.my_exec.pool[self.poolid].stop and not \ self.my_exec.pool[self.poolid].suspend: ! log.msg('Job TERMINATED: %s' % self.poolid) elif self.my_exec.pool[self.poolid].suspend: log.msg('Job SUSPENDED: %s' % self.poolid) else: ! log.msg('Job is COMPLETED: %s exit code:' % self.poolid, self.my_exec.pool[self.poolid].exit_code) class ProcessStatus: *************** *** 459,465 **** pass else: ! log.error() except: ! log.error() class ExecLinux(ExecBase): --- 461,467 ---- pass else: ! log.error('Error: %s' % error) except: ! pass class ExecLinux(ExecBase): *************** *** 571,575 **** raise InitialDirectoryDoesNotExist, "Initial dir does not exists!" ! self.execids.add({'grid_id':job_id, 'initialdir':desc['initialdir'], 'status':BES_OVERALL_STATE_SUSPENDED, 'mem_usage':-1, 'cpu_usage':-1, 'exit_code': None, 'shutdown':False, 'job_migration' : desc['job_migration'] - 1 }) return self._revoke(job_id) --- 573,577 ---- raise InitialDirectoryDoesNotExist, "Initial dir does not exists!" ! self.execids.add({'grid_id':job_id, 'initialdir':desc['initialdir'], 'status':BES_OVERALL_STATE_SUSPENDED, 'mem_usage':-1, 'cpu_usage':-1, 'exit_code': None, 'shutdown':False, 'job_migration' : desc['job_migration'] - 1, 'directory_structure' : desc['directory_structure'] }) return self._revoke(job_id) |
From: Roczei G. <ro...@us...> - 2007-05-13 21:54:00
|
Update of /cvsroot/gug/gug/gug/service/cm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6124 Modified Files: cm.py Log Message: state update bugfix Index: cm.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/cm/cm.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** cm.py 12 May 2007 21:19:52 -0000 1.39 --- cm.py 13 May 2007 21:53:59 -0000 1.40 *************** *** 110,114 **** except: log.error() ! log.error('Job TERMINATED: %s' % job['grid_id']) #Walltime test --- 110,114 ---- except: log.error() ! log.error('Job FAILED: %s' % job['grid_id']) #Walltime test *************** *** 268,272 **** item['error_message'] = 'The job\'s initialdir does not exist: %s' % error item['status'] = BES_OVERALL_STATE_TERMINATED ! log.error('Job TERMINATED: %s' % item['grid_id']) except: log.error() --- 268,272 ---- item['error_message'] = 'The job\'s initialdir does not exist: %s' % error item['status'] = BES_OVERALL_STATE_TERMINATED ! log.error('Job FAILED: %s' % item['grid_id']) except: log.error() *************** *** 360,364 **** self.cmids.commit(job_id) ! log.msg('Job stopped: %s' % job_id) return 1 --- 360,364 ---- self.cmids.commit(job_id) ! log.msg('Job TERMINATED: %s' % job_id) return 1 |
From: Roczei G. <ro...@us...> - 2007-05-13 21:53:18
|
Update of /cvsroot/gug/gug/gug/cli In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5737 Modified Files: clgr.py Log Message: comment parse bugfix Index: clgr.py =================================================================== RCS file: /cvsroot/gug/gug/gug/cli/clgr.py,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** clgr.py 8 May 2007 13:57:39 -0000 1.52 --- clgr.py 13 May 2007 21:53:14 -0000 1.53 *************** *** 297,302 **** d['name'] = l[1:-1] else: ! [k, v] = l.split('=',1) ! d[k.strip()] = v.strip() if d.has_key('name'): jobs.append(d) --- 297,311 ---- d['name'] = l[1:-1] else: ! try: ! [k, v] = l.split('=',1) ! d[k.strip()] = v.strip() ! except ValueError: ! if l[0] == '#': ! continue ! else: ! print('Bad line:\n\n%s\n' % l) ! print('The submit file\'s syntax is this: name = value, for more help use this: grid.py clgr help') ! sys.exit(-1) ! if d.has_key('name'): jobs.append(d) |
From: Roczei G. <ro...@us...> - 2007-05-12 21:19:52
|
Update of /cvsroot/gug/gug/gug/service/cm In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv17540 Modified Files: cm.py Log Message: New state: MIGRATION Index: cm.py =================================================================== RCS file: /cvsroot/gug/gug/gug/service/cm/cm.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** cm.py 30 Apr 2007 22:03:38 -0000 1.38 --- cm.py 12 May 2007 21:19:52 -0000 1.39 *************** *** 226,231 **** continue try: ! if item['exec_job_id'] != False and item['desc']['batchjob'] == False : try: result = good_proxies[exec_id]['proxy'].revoke_repair(item['exec_job_id'], item['desc']) if result == True: --- 226,232 ---- continue try: ! if item['exec_job_id'] != False and item['desc']['batchjob'] == False and item['desc']['checkpoint'] == '1': try: + item['status'] = BES_OVERALL_STATE_MIGRATION result = good_proxies[exec_id]['proxy'].revoke_repair(item['exec_job_id'], item['desc']) if result == True: *************** *** 246,249 **** --- 247,251 ---- except RevokeError, error: log.msg('I cannot repair this job: %s, reason: %s' % (item['grid_id'], error)) + item['status'] = BES_OVERALL_STATE_NEW if result == False: |