Hello,

Fix for https://fedorahosted.org/freeipa/ticket/4575

Thanks,

Gabe
From 6c9ac52a18df8bbce33db09c16494159258ff104 Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Wed, 15 Apr 2015 09:18:58 -0600
Subject: [PATCH] Remove unneeded ip-address option in ipa-adtrust-install

https://fedorahosted.org/freeipa/ticket/4575
---
 install/tools/ipa-adtrust-install       | 25 +------------------------
 install/tools/man/ipa-adtrust-install.1 |  3 ---
 ipaserver/install/adtrustinstance.py    |  4 +---
 3 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/install/tools/ipa-adtrust-install b/install/tools/ipa-adtrust-install
index 6e55bbe3e57f1c609398dc571e90cb8677d91a33..3f8f2105bcaf15bc577aeb87ca4bb0d068909b6e 100755
--- a/install/tools/ipa-adtrust-install
+++ b/install/tools/ipa-adtrust-install
@@ -39,8 +39,6 @@ def parse_options():
     parser = IPAOptionParser(version=version.VERSION)
     parser.add_option("-d", "--debug", dest="debug", action="store_true",
                       default=False, help="print debugging information")
-    parser.add_option("--ip-address", dest="ip_address",
-                      type="ip", ip_local=True, help="Master Server IP Address")
     parser.add_option("--netbios-name", dest="netbios_name",
                       help="NetBIOS name of the IPA domain")
     parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true",
@@ -291,37 +289,16 @@ def main():
         options.enable_compat = enable_compat_tree()
 
     # Check we have a public IP that is associated with the hostname
-    ip = None
     try:
         hostaddr = resolve_host(api.env.host)
         if len(hostaddr) > 1:
             print >> sys.stderr, "The server hostname resolves to more than one address:"
             for addr in hostaddr:
                 print >> sys.stderr, "  %s" % addr
-
-            if options.ip_address:
-                if str(options.ip_address) not in hostaddr:
-                    print >> sys.stderr, "Address passed in --ip-address did not match any resolved"
-                    print >> sys.stderr, "address!"
-                    sys.exit(1)
-                print "Selected IP address:", str(options.ip_address)
-                ip = options.ip_address
-            else:
-                if options.unattended:
-                    print >> sys.stderr, "Please use --ip-address option to specify the address"
-                    sys.exit(1)
-                else:
-                    ip = read_ip_address(api.env.host, fstore)
-        else:
-                ip = hostaddr and ipautil.CheckedIPAddress(hostaddr[0], match_local=True)
     except Exception, e:
-        print "Error: Invalid IP Address %s: %s" % (ip, e)
         print "Aborting installation"
         sys.exit(1)
 
-    ip_address = str(ip)
-    root_logger.debug("will use ip_address: %s\n", ip_address)
-
     admin_password = options.admin_password
     if not (options.unattended or admin_password):
         admin_password = read_admin_password(options.admin_name)
@@ -406,7 +383,7 @@ def main():
     smb = adtrustinstance.ADTRUSTInstance(fstore)
     smb.realm = api.env.realm
     smb.autobind = ipaldap.AUTOBIND_ENABLED
-    smb.setup(api.env.host, ip_address, api.env.realm, api.env.domain,
+    smb.setup(api.env.host, api.env.realm, api.env.domain,
               netbios_name, reset_netbios_name,
               options.rid_base, options.secondary_rid_base,
               options.no_msdcs, options.add_sids,
diff --git a/install/tools/man/ipa-adtrust-install.1 b/install/tools/man/ipa-adtrust-install.1
index b0aa8ceefc34698329b2a13d3adbcb204f08b3a9..a32eefb0e2dd4334b6dc3597b3643743ead56847 100644
--- a/install/tools/man/ipa-adtrust-install.1
+++ b/install/tools/man/ipa-adtrust-install.1
@@ -41,9 +41,6 @@ might be affected as well.
 \fB\-d\fR, \fB\-\-debug\fR
 Enable debug logging when more verbose output is needed
 .TP
-\fB\-\-ip\-address\fR=\fIIP_ADDRESS\fR
-The IP address of the IPA server. If not provided then this is determined based on the hostname of the server.
-.TP
 \fB\-\-netbios\-name\fR=\fINETBIOS_NAME\fR
 The NetBIOS name for the IPA domain. If not provided then this is determined
 based on the leading component of the DNS domain name. Running
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index b4d644fdbf784dd7936adc8eb085f4825cab797e..92c05f26a10c8f90bbe62ae9f6723d5e22ff3833 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -108,7 +108,6 @@ class ADTRUSTInstance(service.Service):
     FALLBACK_GROUP_NAME = u'Default SMB Group'
 
     def __init__(self, fstore=None):
-        self.ip_address = None
         self.netbios_name = None
         self.reset_netbios_name = None
         self.no_msdcs = None
@@ -774,11 +773,10 @@ class ADTRUSTInstance(service.Service):
                              LDAPI_SOCKET = self.ldapi_socket,
                              FQDN = self.fqdn)
 
-    def setup(self, fqdn, ip_address, realm_name, domain_name, netbios_name,
+    def setup(self, fqdn, realm_name, domain_name, netbios_name,
               reset_netbios_name, rid_base, secondary_rid_base,
               no_msdcs=False, add_sids=False, smbd_user="samba", enable_compat=False):
         self.fqdn = fqdn
-        self.ip_address = ip_address
         self.realm = realm_name
         self.domain_name = domain_name
         self.netbios_name = netbios_name
-- 
1.8.3.1

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to