mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
ip_address does not need str() and parse_host_port handles ipv6 or ipv4
note: @isbm requested ip_address objects stay ip_address. They implement __str__ so they should work without explicit str() conversion if necessary.
This commit is contained in:
parent
7a6bc576d1
commit
3574698a70
1 changed files with 2 additions and 2 deletions
|
@ -259,8 +259,8 @@ def prep_ip_port(opts):
|
|||
# Use given master IP if "ip_only" is set or if master_ip is an ipv6 address without
|
||||
# a port specified. The is_ipv6 check returns False if brackets are used in the IP
|
||||
# definition such as master: '[::1]:1234'.
|
||||
if opts['master_uri_format'] == 'ip_only' or salt.utils.network.is_ipv6(opts['master']):
|
||||
ret['master'] = str(ipaddress.ip_address(opts['master']))
|
||||
if opts['master_uri_format'] == 'ip_only':
|
||||
ret['master'] = ipaddress.ip_address(opts['master'])
|
||||
else:
|
||||
host, port = parse_host_port(opts['master'])
|
||||
ret = {'master': host}
|
||||
|
|
Loading…
Add table
Reference in a new issue