]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orch: pass unicode string to ipaddress.ip_network() 31755/head
authorKefu Chai <kchai@redhat.com>
Wed, 20 Nov 2019 08:39:32 +0000 (16:39 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 20 Nov 2019 08:41:09 +0000 (16:41 +0800)
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 <kchai@redhat.com>
src/pybind/mgr/orchestrator.py

index b23b914ef11790c65f6a81edf38b25b5444c1079..ba2156e31915935c9aec2c1c21097bbed75f78db 100644 (file)
@@ -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