Commit fb41ee6f authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Clean up caddyprofiledummy

parent 2bf872bf
...@@ -98,7 +98,7 @@ md5sum = f6f72d03af7d9dc29fb4d4fef1062e73 ...@@ -98,7 +98,7 @@ md5sum = f6f72d03af7d9dc29fb4d4fef1062e73
[caddyprofiledeps-dummy] [caddyprofiledeps-dummy]
filename = caddyprofiledummy.py filename = caddyprofiledummy.py
md5sum = 1c866272ec0ea0c161f0c0d80cb6e584 md5sum = e82ccdb0b26552a1c88ff523d8fae24a
[profile-kedifa] [profile-kedifa]
filename = instance-kedifa.cfg.in filename = instance-kedifa.cfg.in
......
import caucase.client import caucase.client
import caucase.utils import caucase.utils
import os import os
import ssl import ssl
import sys import sys
import urllib.request, urllib.parse, urllib.error import urllib.error
import urllib.parse import urllib.parse
import urllib.request
from cryptography import x509 from cryptography import x509
from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives import serialization
class Recipe(object): class Recipe(object):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
pass pass
...@@ -21,10 +20,11 @@ class Recipe(object): ...@@ -21,10 +20,11 @@ class Recipe(object):
def update(self): def update(self):
return self.install() return self.install()
def validate_netloc(netloc): def validate_netloc(netloc):
# a bit crazy way to validate that the passed parameter is haproxy # a bit crazy way to validate that the passed parameter is haproxy
# compatible server netloc # compatible server netloc
parsed = urllib.parse.urlparse('scheme://'+netloc) parsed = urllib.parse.urlparse('scheme://' + netloc)
if ':' in parsed.hostname: if ':' in parsed.hostname:
hostname = '[%s]' % parsed.hostname hostname = '[%s]' % parsed.hostname
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment