From: Kefu Chai Date: Wed, 20 Nov 2019 08:39:32 +0000 (+0800) Subject: mgr/orch: pass unicode string to ipaddress.ip_network() X-Git-Tag: v15.1.0~836^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3fb8fb0d8e3ca4d6bfc216edfc42c305c88c6aa;p=ceph.git 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 --- diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index b23b914ef117..ba2156e31915 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