ngamsMWA_Pawsey_PushFiles.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:ngas 作者: ICRAR 项目源码 文件源码
def getPushURL(hostId, gateway = None):
    """
    Construct the push url based on the hostId in the cluster

    hostId:    the host (e.g. 192.168.1.1:7777) that will receive the file

    gateway:   a list of gateway hosts separated by comma
               The sequence of this list is from target to source
               e.g. if the dataflow is like:  source --> A --> B --> C --> target
               then, the gateway list should be ordered as: C,B,A
    """
    if (gateway):
        gateways = gateway.split(',')
        gurl = 'http://%s/QARCHIVE' % hostId
        for gw in gateways:
            gurl = 'http://%s/PARCHIVE?nexturl=%s' % (gw, urllib2.quote(gurl))
        #return 'http://%s/PARCHIVE?nexturl=http://%s/QAPLUS' % (gateway, hostId)
        return gurl
    else:
        return 'http://%s/QARCHIVE' % hostId
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号