Correct parsing of IPv6 addresses for node.js

parent 3a69f7e1
...@@ -28,6 +28,7 @@ from slapos.recipe.librecipe import BaseSlapRecipe ...@@ -28,6 +28,7 @@ from slapos.recipe.librecipe import BaseSlapRecipe
import os import os
import pkg_resources import pkg_resources
import hashlib import hashlib
import string
import sys import sys
import zc.buildout import zc.buildout
import zc.recipe.egg import zc.recipe.egg
...@@ -250,7 +251,9 @@ class Recipe(BaseSlapRecipe): ...@@ -250,7 +251,9 @@ class Recipe(BaseSlapRecipe):
rewrite_rule_list = [] rewrite_rule_list = []
for slave_instance in slave_instance_list: for slave_instance in slave_instance_list:
current_slave_dict = dict() current_slave_dict = dict()
current_slave_dict['host'] = slave_instance['host'] # Get host, and if IPv6 address, remove "[" and "]"
current_slave_dict['host'] = string.replace(string.replace(
slave_instance['host'], '[', ''), ']', '')
current_slave_dict['port'] = slave_instance['port'] current_slave_dict['port'] = slave_instance['port']
if current_slave_dict['host'] is None \ if current_slave_dict['host'] is None \
or current_slave_dict['port'] is None: or current_slave_dict['port'] is None:
......
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