DNS Locations: hide option --no-msdcs in adtrust-install

Since DNS location mechanism is active, this option has no effect,
because records are generate dynamically.

https://fedorahosted.org/freeipa/ticket/2008

Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
Martin Basti
2016-06-21 18:17:55 +02:00
parent e42f662b78
commit 218734ba5a
2 changed files with 15 additions and 16 deletions

View File

@@ -29,6 +29,8 @@ import ldap
import six import six
from optparse import SUPPRESS_HELP
from ipaserver.install import adtrustinstance from ipaserver.install import adtrustinstance
from ipaserver.install.installutils import ( from ipaserver.install.installutils import (
read_password, read_password,
@@ -54,9 +56,11 @@ def parse_options():
default=False, help="print debugging information") default=False, help="print debugging information")
parser.add_option("--netbios-name", dest="netbios_name", parser.add_option("--netbios-name", dest="netbios_name",
help="NetBIOS name of the IPA domain") help="NetBIOS name of the IPA domain")
# no-msdcs has not effect, option is here just for backward compatibility
parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true", parser.add_option("--no-msdcs", dest="no_msdcs", action="store_true",
default=False, help="Do not create DNS service records " \ default=False, help=SUPPRESS_HELP)
"for Windows in managed DNS server")
parser.add_option("--rid-base", dest="rid_base", type=int, default=1000, parser.add_option("--rid-base", dest="rid_base", type=int, default=1000,
help="Start value for mapping UIDs and GIDs to RIDs") help="Start value for mapping UIDs and GIDs to RIDs")
parser.add_option("--secondary-rid-base", dest="secondary_rid_base", parser.add_option("--secondary-rid-base", dest="secondary_rid_base",
@@ -390,7 +394,7 @@ def main():
smb.setup(api.env.host, api.env.realm, smb.setup(api.env.host, api.env.realm,
netbios_name, reset_netbios_name, netbios_name, reset_netbios_name,
options.rid_base, options.secondary_rid_base, options.rid_base, options.secondary_rid_base,
options.no_msdcs, options.add_sids, options.add_sids,
enable_compat = options.enable_compat) enable_compat = options.enable_compat)
smb.find_local_id_range() smb.find_local_id_range()
smb.create_instance() smb.create_instance()

View File

@@ -124,7 +124,6 @@ class ADTRUSTInstance(service.Service):
def __init__(self, fstore=None): def __init__(self, fstore=None):
self.netbios_name = None self.netbios_name = None
self.reset_netbios_name = None self.reset_netbios_name = None
self.no_msdcs = None
self.add_sids = None self.add_sids = None
self.smbd_user = None self.smbd_user = None
self.smb_dn_pwd = None self.smb_dn_pwd = None
@@ -585,17 +584,14 @@ class ADTRUSTInstance(service.Service):
err_msg = None err_msg = None
if self.no_msdcs: ret = api.Command['dns_is_enabled']()
err_msg = '--no-msdcs was given, special DNS service records ' \ if not ret['result']:
'are not added to local DNS server' err_msg = "DNS management was not enabled at install time."
else: else:
ret = api.Command['dns_is_enabled']() if not dns_zone_exists(zone):
if not ret['result']: err_msg = (
err_msg = "DNS management was not enabled at install time." "DNS zone %s cannot be managed as it is not defined in "
else: "IPA" % zone)
if not dns_zone_exists(zone):
err_msg = "DNS zone %s cannot be managed " \
"as it is not defined in IPA" % zone
if err_msg: if err_msg:
self.print_msg(err_msg) self.print_msg(err_msg)
@@ -766,7 +762,7 @@ class ADTRUSTInstance(service.Service):
def setup(self, fqdn, realm_name, netbios_name, def setup(self, fqdn, realm_name, netbios_name,
reset_netbios_name, rid_base, secondary_rid_base, reset_netbios_name, rid_base, secondary_rid_base,
no_msdcs=False, add_sids=False, smbd_user="samba", add_sids=False, smbd_user="samba",
enable_compat=False): enable_compat=False):
self.fqdn = fqdn self.fqdn = fqdn
self.realm = realm_name self.realm = realm_name
@@ -774,7 +770,6 @@ class ADTRUSTInstance(service.Service):
self.reset_netbios_name = reset_netbios_name self.reset_netbios_name = reset_netbios_name
self.rid_base = rid_base self.rid_base = rid_base
self.secondary_rid_base = secondary_rid_base self.secondary_rid_base = secondary_rid_base
self.no_msdcs = no_msdcs
self.add_sids = add_sids self.add_sids = add_sids
self.enable_compat = enable_compat self.enable_compat = enable_compat
self.smbd_user = smbd_user self.smbd_user = smbd_user