URL: https://github.com/freeipa/freeipa/pull/111
Author: tomaskrizek
 Title: #111: Prompt for forwarder in dnsforwardzone-add
Action: opened

PR body:
"""
When the command ipa dnsforwardzone-add is invoked without
specifying the forwarder as an argument and the forward
policy is not set to none, prompt for DNS forwarder.

https://fedorahosted.org/freeipa/ticket/6169
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/111/head:pr111
git checkout pr111
From ed8f86f40b31c62b5636557ded9bfbe82d643137 Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Fri, 23 Sep 2016 13:26:40 +0200
Subject: [PATCH] Prompt for forwarder in dnsforwardzone-add

When the command ipa dnsforwardzone-add is invoked without
specifying the forwarder as an argument and the forward
policy is not set to none, prompt for DNS forwarder.

https://fedorahosted.org/freeipa/ticket/6169
---
 ipaclient/plugins/dns.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ipaclient/plugins/dns.py b/ipaclient/plugins/dns.py
index b9ab709..42ccd3d 100644
--- a/ipaclient/plugins/dns.py
+++ b/ipaclient/plugins/dns.py
@@ -389,6 +389,11 @@ def interactive_prompt_callback(self, kw):
 @register(override=True, no_fail=True)
 class dnsforwardzone_add(MethodOverride):
     def interactive_prompt_callback(self, kw):
+        if ('idnsforwarders' not in kw and
+                kw.get('idnsforwardpolicy') != u'none'):
+            kw['idnsforwarders'] = self.Backend.textui.prompt(
+                _(u'DNS forwarder'))
+
         # show informative message on client side
         # server cannot send messages asynchronous
         if kw.get('idnsforwarders', False):
-- 
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