diff options
author | Jan Cholasta <jcholast@redhat.com> | 2011-05-27 20:17:22 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-05-30 13:36:26 +0200 |
commit | 80b4b3d44bbbe745e644b56c5371ef5f4cda6600 (patch) | |
tree | 970dd0df7105626fa997330afe0b30026dfcc5bf /install/tools/ipa-dns-install | |
parent | 868d4e734ed0f22221f25a1067fbf57141b64c21 (diff) | |
download | freeipa-80b4b3d44bbbe745e644b56c5371ef5f4cda6600.tar.gz freeipa-80b4b3d44bbbe745e644b56c5371ef5f4cda6600.tar.xz freeipa-80b4b3d44bbbe745e644b56c5371ef5f4cda6600.zip |
Parse netmasks in IP addresses passed to server install.
ticket 1212
Diffstat (limited to 'install/tools/ipa-dns-install')
-rwxr-xr-x | install/tools/ipa-dns-install | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install index a76329767..e8379191a 100755 --- a/install/tools/ipa-dns-install +++ b/install/tools/ipa-dns-install @@ -37,9 +37,10 @@ def parse_options(): sensitive=True, help="admin password") parser.add_option("-d", "--debug", dest="debug", action="store_true", default=False, help="print debugging information") - parser.add_option("--ip-address", dest="ip_address", help="Master Server IP Address") + parser.add_option("--ip-address", dest="ip_address", + type="ipnet", help="Master Server IP Address") parser.add_option("--forwarder", dest="forwarders", action="append", - help="Add a DNS forwarder") + type="ipaddr", help="Add a DNS forwarder") parser.add_option("--no-forwarders", dest="no_forwarders", action="store_true", default=False, help="Do not add any DNS forwarders, use root servers instead") parser.add_option("--no-reverse", dest="no_reverse", @@ -105,12 +106,14 @@ def main(): if options.ip_address: ip_address = options.ip_address else: - ip_address = resolve_host(api.env.host) + hostaddr = resolve_host(api.env.host) + ip_address = hostaddr and ipautil.CheckedIPAddress(hostaddr) if not ip_address or not verify_ip_address(ip_address): if options.unattended: sys.exit("Unable to resolve IP address for host name") else: ip_address = read_ip_address(api.env.host, fstore) + ip_address = str(ip_address) logging.debug("will use ip_address: %s\n", ip_address) if options.no_forwarders: |