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))
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))
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))
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))
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