コード例 #1
0
ファイル: actions.py プロジェクト: juztas/phedex-fdt
 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
コード例 #2
0
ファイル: actions.py プロジェクト: fno2010/fdtcp
 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
コード例 #3
0
def testGetDateTime():
    dateTime = getDateTime()
    assert isinstance(dateTime, str)
    assert len(dateTime) > 1
コード例 #4
0
ファイル: test_utils.py プロジェクト: juztas/fdtcp
def testGetDateTime():
    dateTime = getDateTime()
    assert isinstance(dateTime, str)
    assert len(dateTime) > 1