コード例 #1
0
ファイル: utils.py プロジェクト: Ezio47/qgis-geoserver-plugin
def getGeoServerCatalog(authcfgid=None, authtype=None):
    # beaware that these envs can be overrided by os.environ envs cnaging
    # the function behaviour
    if authcfgid:
        conf = dict(
            URL = serverLocationPkiAuth()+'/rest',
            USER = None,
            PASSWORD = None,
            AUTHCFG = authcfgid,
            AUTHTYPE = authtype
        )
    else:
        conf = dict(
            URL = serverLocationBasicAuth()+'/rest',
            USER = GSUSER,
            PASSWORD = GSPASSWORD,
            AUTHCFG = authcfgid,
            AUTHTYPE = authtype
        )
    conf.update([ (k,os.getenv('GS%s' % k)) for k in conf if 'GS%s' % k in os.environ])
    cat = createGeoServerCatalog(conf['URL'], conf['USER'], conf['PASSWORD'], conf['AUTHCFG'], conf['AUTHTYPE'])
    try:
        cat.catalog.gsversion()
    except Exception, ex:
        msg = 'cannot reach geoserver using provided credentials %s, msg is %s'
        raise AssertionError(msg % (conf,ex))
コード例 #2
0
def getGeoServerCatalog(authcfgid=None, authtype=None):
    # beaware that these envs can be overrided by os.environ envs cnaging
    # the function behaviour
    if authcfgid:
        conf = dict(
            URL=serverLocationPkiAuth()+'/rest',
            USER=None,
            PASSWORD=None,
            AUTHCFG=authcfgid,
            AUTHTYPE=authtype
        )
    else:
        conf = dict(
            URL=serverLocationBasicAuth()+'/rest',
            USER=GSUSER,
            PASSWORD=GSPASSWORD,
            AUTHCFG=authcfgid,
            AUTHTYPE=authtype
        )
    conf.update([(k, os.getenv('GS%s' % k))
                for k in conf if 'GS%s' % k in os.environ])
    cat = createGeoServerCatalog(conf['URL'], conf['USER'], conf['PASSWORD'],
                                 conf['AUTHCFG'], conf['AUTHTYPE'])
    try:
        cat.catalog.gsversion()
    except Exception, ex:
        msg = 'cannot reach geoserver using provided credentials %s, msg is %s'
        raise AssertionError(msg % (conf, ex))
コード例 #3
0
def getGeoServerCatalog():
    conf = dict(URL='http://localhost:8080/geoserver/rest',
                USER='******',
                PASSWORD='******')
    conf.update([(k, os.getenv('GS%s' % k)) for k in conf
                 if 'GS%s' % k in os.environ])
    cat = createGeoServerCatalog(conf['URL'], conf['USER'], conf['PASSWORD'])
    try:
        cat.catalog.gsversion()
    except Exception, ex:
        msg = 'cannot reach geoserver using provided credentials %s, msg is %s'
        raise AssertionError(msg % (conf, ex))
コード例 #4
0
ファイル: utils.py プロジェクト: rajGSC/qgis-geoserver-plugin
def getGeoServerCatalog():
    conf = dict(
        URL = 'http://'+geoserverLocation()+'/geoserver/rest',
        USER = '******',
        PASSWORD = '******'
    )
    conf.update([ (k,os.getenv('GS%s' % k)) for k in conf if 'GS%s' % k in os.environ])
    cat = createGeoServerCatalog(conf['URL'], conf['USER'], conf['PASSWORD'])
    try:
        cat.catalog.gsversion()
    except Exception, ex:
        msg = 'cannot reach geoserver using provided credentials %s, msg is %s'
        raise AssertionError(msg % (conf,ex))
コード例 #5
0
def getGeoServerCatalog():
    authid = AUTHCFGID if USEAUTHSYSTEM else None
    conf = dict(
        URL=serverLocationBasicAuth()+'/rest',
        USER=GSUSER,
        PASSWORD=GSPASSWORD,
        AUTHCFG=authid)

    conf.update([(k, os.getenv('GS%s' % k))
                for k in conf if 'GS%s' % k in os.environ])
    cat = createGeoServerCatalog(conf['URL'], conf['USER'], conf['PASSWORD'],
                                 conf['AUTHCFG'])
    try:
        cat.catalog.gsversion()
    except Exception as ex:
        msg = 'cannot reach geoserver using provided credentials %s, msg is %s'
        raise AssertionError(msg % (conf, ex))
    return cat
コード例 #6
0
ファイル: utils.py プロジェクト: GeoCat/qgis-geoserver-plugin
def getGeoServerCatalog():
    authid = AUTHCFGID if USEAUTHSYSTEM else None
    conf = dict(
        URL=serverLocationBasicAuth()+'/rest',
        USER=GSUSER,
        PASSWORD=GSPASSWORD,
        AUTHCFG=authid)

    conf.update([(k, os.getenv('GS%s' % k))
                for k in conf if 'GS%s' % k in os.environ])
    cat = createGeoServerCatalog(conf['URL'], conf['USER'], conf['PASSWORD'],
                                 conf['AUTHCFG'])
    try:
        cat.catalog.gsversion()
    except Exception as ex:
        msg = 'cannot reach geoserver using provided credentials %s, msg is %s'
        raise AssertionError(msg % (conf, ex))
    return cat