Esempio n. 1
0
 def _getId(self):
     """Transfer job / request / id will consist of hostname of the
        machine fdtcp is invoked on and timestamp. This id will be used
        in all requests to fdtd for tracking the state of the transfer
        job, esp. by MonALISA ApMon.
        Transfers at fdtd will be associated with this ID - make it as
        unique as possible to avoid collisions.
     """
     h = getHostName()
     u = getUserName()
     dt = getDateTime()
     r = getRandomString('a', 'z', 5)
     id = "fdtcp-%s-%s-%s-%s" % (h, u, dt, r)
     return id
Esempio n. 2
0
 def _getId(self, srcHostName, dstHostName):
     """
     Transfer job / request / id will consist of hostname of the
     machine fdtcp is invoked on and timestamp. This id will be used
     in all requests to fdtd for tracking the state of the transfer
     job, esp. by MonALISA ApMon.
     Transfers at fdtd will be associated with this ID - make it as
     unique as possible to avoid collisions.
     """
     h = getHostName()
     # u = getUserName()
     dt = getDateTime()
     r = getRandomString('a', 'z', 5)
     template = "fdtcp-%(host)s--%(source)s-to-%(dest)s--%(datetime)s-%(randomStr)s"
     d = dict(host=h, source=srcHostName, dest=dstHostName,
              datetime=dt, randomStr=r)
     idT = template % d
     return idT
Esempio n. 3
0
def testGetDateTime():
    dateTime = getDateTime()
    assert isinstance(dateTime, str)
    assert len(dateTime) > 1
Esempio n. 4
0
def testGetDateTime():
    dateTime = getDateTime()
    assert isinstance(dateTime, str)
    assert len(dateTime) > 1