def test_vo_list(self, appdb_call): vos = '<vo:vo id="15551" name="acc-comp.egi.eu"></vo:vo>' appdb_call.return_value = xmltodict.parse(vos.replace('\n', '')) res = appdb.get_vo_list() self.assertEquals(res, ['acc-comp.egi.eu']) vos = '<appdb:appdb><vo:vo id="15551" name="acc-comp.egi.eu"></vo:vo>' vos += '<vo:vo id="15527" name="vo.access.egi.eu"></vo:vo></appdb:appdb>' appdb_call.return_value = xmltodict.parse(vos)["appdb:appdb"] res = appdb.get_vo_list() self.assertEquals(res, ['acc-comp.egi.eu', 'vo.access.egi.eu'])
def getvos(): res = "" vos = utils.getStaticVOs() vos.extend(appdb.get_vo_list()) vos = list(set(vos)) if "vos" in session and session["vos"]: vos = [vo for vo in vos if vo in session["vos"]] for vo in vos: res += '<option name="selectedVO" value=%s>%s</option>' % (vo, vo) return res
def configure(): selected_tosca = request.args['selected_tosca'] app.logger.debug("Template: " + json.dumps(toscaInfo[selected_tosca])) vos = utils.getStaticVOs() vos.extend(appdb.get_vo_list()) vos = list(set(vos)) if "vos" in session and session["vos"]: vos = [vo for vo in vos if vo in session["vos"]] return render_template('createdep.html', template=toscaInfo[selected_tosca], selectedTemplate=selected_tosca, vos=vos)