예제 #1
0
    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'])
예제 #2
0
 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
예제 #3
0
    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)