Blob Blame History Raw
From dd004f9393f0543c556d417d27b9f652b6fe4c99 Mon Sep 17 00:00:00 2001
From: Martin Basti <mbasti@redhat.com>
Date: Wed, 14 Jun 2017 15:02:21 +0200
Subject: [PATCH] Remove ip_netmask from option parser

ipa-dns-install uses ip_netmask=False --> parse_netmask=False, other installers uses default (parse_netmask=True).
Use this consistent accross all installers.

Also this option is unused (and shouldn't be used).

https://pagure.io/freeipa/issue/4317

Reviewed-By: David Kupka <dkupka@redhat.com>
---
 ipapython/config.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ipapython/config.py b/ipapython/config.py
index 6349892fe88757629129f464401efce64e30f058..19abfc51ee354d2971be836fa6bad70eea3a6720 100644
--- a/ipapython/config.py
+++ b/ipapython/config.py
@@ -68,9 +68,8 @@ class IPAFormatter(IndentedHelpFormatter):
 def check_ip_option(option, opt, value):
     from ipapython.ipautil import CheckedIPAddress
 
-    ip_netmask = option.ip_netmask is True
     try:
-        return CheckedIPAddress(value, parse_netmask=ip_netmask)
+        return CheckedIPAddress(value)
     except Exception as e:
         raise OptionValueError("option %s: invalid IP address %s: %s" % (opt, value, e))
 
@@ -85,7 +84,7 @@ class IPAOption(Option):
     optparse.Option subclass with support of options labeled as
     security-sensitive such as passwords.
     """
-    ATTRS = Option.ATTRS + ["sensitive", "ip_netmask"]
+    ATTRS = Option.ATTRS + ["sensitive"]
     TYPES = Option.TYPES + ("ip", "dn")
     TYPE_CHECKER = copy(Option.TYPE_CHECKER)
     TYPE_CHECKER["ip"] = check_ip_option
-- 
2.9.4