From d3fb8fb0d8e3ca4d6bfc216edfc42c305c88c6aa Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 20 Nov 2019 16:39:32 +0800 Subject: [PATCH] mgr/orch: pass unicode string to ipaddress.ip_network() otherwise it complains like > raise e E AddressValueError: '10.1.1.10' does not appear to be an IPv4 or IPv6 address. Did you pass in a bytes (str in Python 2) instead of a unicode object? orchestrator.py:94: AddressValueError Signed-off-by: Kefu Chai --- src/pybind/mgr/orchestrator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index b23b914ef1179..ba2156e319159 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -14,6 +14,7 @@ import random import datetime import copy import re +import six from ceph.deployment import inventory @@ -86,9 +87,9 @@ def parse_host_specs(host, require_network=True): try: # if subnets are defined, also verify the validity if '/' in network: - ip_network(network) + ip_network(six.text_type(network)) else: - ip_address(network) + ip_address(six.text_type(network)) except ValueError as e: # logging? raise e -- 2.39.5