forked from PanDAWMS/pilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Site.py
22 lines (16 loc) · 801 Bytes
/
Site.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os, time
# NOTE: should this be incorporated into new SiteInformation class?
class Site:
""" site information """
def setSiteInfo(self, t1=None):
""" Set the current site info """
# t1 is a tuple of (sitename, appdir, tmpdir, queuename)
self.sitename = t1[0] # site name
self.appdir = t1[1] # APPDIR
self.wntmpdir = t1[2] # tmp dir
self.workdir = self.getWorkDir() # site workdir
self.computingElement = t1[3] # queuename
def getWorkDir(self):
""" When there are multi-jobs, the site workdir needs to be updated """
jobworkdir = "Panda_Pilot_%d_%s" % (os.getpid(), str(int(time.time())))
return os.path.join(self.wntmpdir, jobworkdir) # this pilots' workdir