igw: add support for IPv6

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 0aff0e9ede)

Conflicts:
	library/igw_purge.py: trivial resolution
	roles/ceph-iscsi-gw/library/igw_purge.py: trivial resolution
pull/3331/head v3.2.0rc2
Jason Dillaman 2018-11-02 10:30:34 -04:00 committed by mergify[bot]
parent 702f2baccc
commit 3b40e2bc87
2 changed files with 12 additions and 8 deletions

View File

@ -44,7 +44,7 @@ from ansible.module_utils.basic import *
import ceph_iscsi_config.settings as settings
from ceph_iscsi_config.common import Config
from ceph_iscsi_config.lio import LIO, Gateway
from ceph_iscsi_config.utils import ipv4_addresses, get_ip
from ceph_iscsi_config.utils import ip_addresses, resolve_ip_addresses
__author__ = 'pcuzner@redhat.com'
@ -93,10 +93,12 @@ def is_cleanup_host(config):
gw_1 = config.config["gateways"]["ip_list"][0]
usable_ip = get_ip(gw_1)
if usable_ip != '0.0.0.0':
if usable_ip in ipv4_addresses():
local_ips = ip_addresses()
usable_ips = resolve_ip_addresses(gw_1)
for ip in usable_ips:
if ip in local_ips:
cleanup = True
break
return cleanup

View File

@ -44,7 +44,7 @@ from ansible.module_utils.basic import *
import ceph_iscsi_config.settings as settings
from ceph_iscsi_config.common import Config
from ceph_iscsi_config.lio import LIO, Gateway
from ceph_iscsi_config.utils import ipv4_addresses, get_ip
from ceph_iscsi_config.utils import ip_addresses, resolve_ip_addresses
__author__ = 'pcuzner@redhat.com'
@ -93,10 +93,12 @@ def is_cleanup_host(config):
gw_1 = config.config["gateways"]["ip_list"][0]
usable_ip = get_ip(gw_1)
if usable_ip != '0.0.0.0':
if usable_ip in ipv4_addresses():
local_ips = ip_addresses()
usable_ips = resolve_ip_addresses(gw_1)
for ip in usable_ips:
if ip in local_ips:
cleanup = True
break
return cleanup