Changeset 4c3cf1c in osmose-backend


Ignore:
Timestamp:
Apr 22, 2013 10:26:42 PM (7 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
3b4265b
Parents:
4a64c1c
git-author:
osmose <osmose@…> (22/04/2013 22:21:10)
git-committer:
Jocelyn Jaubert <jocelyn.jaubert@…> (22/04/2013 22:26:42)
Message:

Set JAVACMD_OPTIONS at the beginning, and add support for http_proxy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osmose_run.py

    r14ecf90 r4c3cf1c  
    174174        # data 
    175175        logger.log(log_av_r+"import osmosis data"+log_ap) 
    176         os.environ["JAVACMD_OPTIONS"] = "-Xms2048M -Xmx2048M -XX:MaxPermSize=2048M -Djava.io.tmpdir="+conf.dir_tmp 
    177176        cmd  = [conf.osmosis_bin] 
    178177        dst_ext = os.path.splitext(conf.download["dst"])[1] 
     
    279278    else: 
    280279        os.makedirs(diff_path) 
    281     os.environ["JAVACMD_OPTIONS"] = "-Xms2048M -Xmx2048M -XX:MaxPermSize=2048M -Djava.io.tmpdir="+conf.dir_tmp 
    282280    cmd  = [conf.osmosis_bin] 
    283281    cmd += ["--read-replication-interval-init", "workingDirectory=%s" % diff_path] 
     
    316314 
    317315    try: 
    318         os.environ["JAVACMD_OPTIONS"] = "-Xms2048M -Xmx2048M -XX:MaxPermSize=2048M -Djava.io.tmpdir="+conf.dir_tmp 
    319316        cmd  = [conf.osmosis_bin] 
    320317        cmd += ["--read-replication-interval", "workingDirectory=%s" % diff_path] 
     
    387384 
    388385    try: 
    389         os.environ["JAVACMD_OPTIONS"] = "-Xms2048M -Xmx2048M -XX:MaxPermSize=2048M -Djava.io.tmpdir="+conf.dir_tmp 
    390386        cmd  = [conf.osmosis_bin] 
    391387        cmd += ["--read-replication-interval", "workingDirectory=%s" % diff_path] 
     
    434430        logger.log(log_av_r+u"error in database initialisation"+log_ap) 
    435431        return 
     432 
     433    # variable used by osmosis 
     434    os.environ["JAVACMD_OPTIONS"] = "-Xms2048M -Xmx2048M -XX:MaxPermSize=2048M -Djava.io.tmpdir="+conf.dir_tmp 
     435    if "http_proxy" in os.environ: 
     436        (_tmp, host, port) = os.environ["http_proxy"].split(":") 
     437        host = host.split("/")[2] 
     438        os.environ["JAVACMD_OPTIONS"] += " -Dhttp.proxyHost=%s -Dhttp.proxyPort=%s" % (host, port) 
     439        os.environ["JAVACMD_OPTIONS"] += " -Djava.net.preferIPv6Addresses=false" 
    436440 
    437441    ########################################################################## 
Note: See TracChangeset for help on using the changeset viewer.