Пример #1
0
def add_pool_cert(pool, request):
    pool.cert = None
    if pool.vip_id:
        try:
            cert = avi.get_vip_cert(request, pool.vip_id)
            if cert:
                pool.cert = cert
        except Exception as e:
            print "Error in obtaining certificate info: %s" % e
    return pool
def add_pool_cert(pool, request):
    pool.cert = None
    if pool.vip_id:
        try:
            cert = avi.get_vip_cert(request, pool.vip_id)
            if cert:
                pool.cert = cert
        except Exception as e:
            print "Error in obtaining certificate info: %s" % e
    return pool
Пример #3
0
def add_pool_vip_info(pool, request):
    pool.cert = None
    if pool.vip_id:
        try:
            vip = avi.get_vip(request, pool.vip_id)
            cert = avi.get_vip_cert(vip)
            if cert:
                pool.cert = cert
            http_port = avi.get_vip_http_port(vip)
            if http_port > 0:
                pool.http_port = http_port
        except Exception as e:
            print "Error in obtaining certificate info: %s" % e
    return pool
 def allowed(self, request, datum=None):
     if not datum:
         return False
     if not _filter_allowed(request, datum):
         return False
     # pool+vip proto is HTTP or HTTPS
     try:
         v = avi.get_vip_cert(request, datum.vip_id)
     except:
         # this prevents non-avi providers
         return False
     if v:
         return True
     if datum.protocol == 'HTTP':
         return False
     p = avi.get_pool_cert(request, datum.id)
     if p:
         return True
     return False
Пример #5
0
 def allowed(self, request, datum=None):
     if not datum:
         return False
     if not _filter_allowed(request, datum):
         return False
     # pool+vip proto is HTTP or HTTPS
     try:
         vip = avi.get_vip(request, datum.vip_id)
         cert = avi.get_vip_cert(vip)
     except:
         # this prevents non-avi providers
         return False
     if cert:
         return True
     if datum.protocol == 'HTTP':
         return False
     p = avi.get_pool_cert(request, datum.id)
     if p:
         return True
     return False
Пример #6
0
 def allowed(self, request, datum=None):
     if not datum:
         return False
     if not _filter_allowed(request, datum):
         return False
     # pool+vip proto is HTTP or HTTPS
     try:
         vip = avi.get_vip(request, datum.vip_id)
         cert = avi.get_vip_cert(vip)
     except:
         # this prevents non-avi providers
         return False
     if not cert:
         return True
     if datum.protocol == 'HTTP':
         return False
     p = avi.get_pool_cert(request, datum.id)
     if p:
         return False
     # atleast one of them doesnt have a certificate
     return True