Re: [Freeipa-devel] [PATCH] 90 Run interactive_prompt callbacks after CSV values are split

2013-02-19 Thread Rob Crittenden

Petr Viktorin wrote:

On 02/19/2013 01:57 PM, Jan Cholasta wrote:

On 14.2.2013 10:45, Petr Viktorin wrote:

This needs a test; here one I used to check it.
Otherwise it works well, ACK if the test is added.



Thank you, test added.

Honza



ACK



Pushed to master and ipa-3-1

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 90 Run interactive_prompt callbacks after CSV values are split

2013-02-19 Thread Petr Viktorin

On 02/19/2013 01:57 PM, Jan Cholasta wrote:

On 14.2.2013 10:45, Petr Viktorin wrote:

This needs a test; here one I used to check it.
Otherwise it works well, ACK if the test is added.



Thank you, test added.

Honza



ACK

--
PetrĀ³

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 90 Run interactive_prompt callbacks after CSV values are split

2013-02-19 Thread Jan Cholasta

On 14.2.2013 10:45, Petr Viktorin wrote:

This needs a test; here one I used to check it.
Otherwise it works well, ACK if the test is added.



Thank you, test added.

Honza

--
Jan Cholasta
>From d845724362507c662e45f21396b46ce520f25a45 Mon Sep 17 00:00:00 2001
From: Jan Cholasta 
Date: Wed, 9 Jan 2013 18:09:10 +0100
Subject: [PATCH] Run interactive_prompt callbacks after CSV values are split.

https://fedorahosted.org/freeipa/ticket/3334
---
 ipalib/cli.py  | 16 
 tests/test_cmdline/test_cli.py | 28 
 2 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index ca186c7..3d59e4a 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -1045,6 +1045,14 @@ class cli(backend.Executioner):
 if self.env.interactive:
 self.prompt_interactively(cmd, kw)
 kw = cmd.split_csv(**kw)
+if self.env.interactive:
+try:
+callbacks = cmd.get_callbacks('interactive_prompt')
+except AttributeError:
+pass
+else:
+for callback in callbacks:
+callback(cmd, kw)
 kw['version'] = API_VERSION
 self.load_files(cmd, kw)
 return kw
@@ -1207,14 +1215,6 @@ class cli(backend.Executioner):
 param.label, param.confirm
 )
 
-try:
-callbacks = cmd.get_callbacks('interactive_prompt')
-except AttributeError:
-pass
-else:
-for callback in callbacks:
-callback(cmd, kw)
-
 def load_files(self, cmd, kw):
 """
 Load files from File parameters.
diff --git a/tests/test_cmdline/test_cli.py b/tests/test_cmdline/test_cli.py
index 06c6124..4d730d5 100644
--- a/tests/test_cmdline/test_cli.py
+++ b/tests/test_cmdline/test_cli.py
@@ -237,3 +237,31 @@ class TestCLIParsing(object):
 all=False,
 force=False,
 version=API_VERSION)
+
+def test_dnsrecord_del_comma(self):
+try:
+self.run_command(
+'dnszone_add', idnsname=u'test-example.com',
+idnssoamname=u'ns.test-example.com', force=True)
+except errors.NotFound:
+raise nose.SkipTest('DNS is not configured')
+try:
+self.run_command(
+'dnsrecord_add',
+dnszoneidnsname=u'test-example.com',
+idnsname=u'test',
+txtrecord=u'"A pretty little problem," said Holmes.')
+with self.fake_stdin('no\nyes\n'):
+self.check_command(
+'dnsrecord_del test-example.com test',
+'dnsrecord_del',
+dnszoneidnsname=u'test-example.com',
+idnsname=u'test',
+del_all=False,
+txtrecord=[u'"A pretty little problem," said Holmes.'],
+structured=False,
+raw=False,
+all=False,
+version=API_VERSION)
+finally:
+self.run_command('dnszone_del', idnsname=u'test-example.com')
-- 
1.8.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] 90 Run interactive_prompt callbacks after CSV values are split

2013-02-14 Thread Petr Viktorin

On 01/09/2013 06:13 PM, Jan Cholasta wrote:

Hi,

this patch fixes .

Honza



This needs a test; here one I used to check it.
Otherwise it works well, ACK if the test is added.

--
PetrĀ³

From 319a6b5ad7df59cf725160b9cb0ace3afdd2c708 Mon Sep 17 00:00:00 2001
From: Petr Viktorin 
Date: Thu, 14 Feb 2013 04:29:56 -0500
Subject: [PATCH] Add a test for interactive_prompt on DNS record with comma

https://fedorahosted.org/freeipa/ticket/3334
---
 tests/test_cmdline/test_cli.py |   28 
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/tests/test_cmdline/test_cli.py b/tests/test_cmdline/test_cli.py
index 06c6124bb1d3ac57add9e44d1754238063039c6d..4d730d582bf4622347e882158d72fef7b7bd6c06 100644
--- a/tests/test_cmdline/test_cli.py
+++ b/tests/test_cmdline/test_cli.py
@@ -237,3 +237,31 @@ class TestCLIParsing(object):
 all=False,
 force=False,
 version=API_VERSION)
+
+def test_dnsrecord_del_comma(self):
+try:
+self.run_command(
+'dnszone_add', idnsname=u'test-example.com',
+idnssoamname=u'ns.test-example.com', force=True)
+except errors.NotFound:
+raise nose.SkipTest('DNS is not configured')
+try:
+self.run_command(
+'dnsrecord_add',
+dnszoneidnsname=u'test-example.com',
+idnsname=u'test',
+txtrecord=u'"A pretty little problem," said Holmes.')
+with self.fake_stdin('no\nyes\n'):
+self.check_command(
+'dnsrecord_del test-example.com test',
+'dnsrecord_del',
+dnszoneidnsname=u'test-example.com',
+idnsname=u'test',
+del_all=False,
+txtrecord=[u'"A pretty little problem," said Holmes.'],
+structured=False,
+raw=False,
+all=False,
+version=API_VERSION)
+finally:
+self.run_command('dnszone_del', idnsname=u'test-example.com')
-- 
1.7.7.6

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

[Freeipa-devel] [PATCH] 90 Run interactive_prompt callbacks after CSV values are split

2013-01-09 Thread Jan Cholasta

Hi,

this patch fixes .

Honza

--
Jan Cholasta
>From 43343dae9ed8cbac6806dd3f7f548b28c872c365 Mon Sep 17 00:00:00 2001
From: Jan Cholasta 
Date: Wed, 9 Jan 2013 18:09:10 +0100
Subject: [PATCH] Run interactive_prompt callbacks after CSV values are split.

https://fedorahosted.org/freeipa/ticket/3334
---
 ipalib/cli.py | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index ac0eb05..899220d 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -1034,6 +1034,14 @@ class cli(backend.Executioner):
 if self.env.interactive:
 self.prompt_interactively(cmd, kw)
 kw = cmd.split_csv(**kw)
+if self.env.interactive:
+try:
+callbacks = cmd.get_callbacks('interactive_prompt')
+except AttributeError:
+pass
+else:
+for callback in callbacks:
+callback(cmd, kw)
 kw['version'] = API_VERSION
 self.load_files(cmd, kw)
 return kw
@@ -1195,14 +1203,6 @@ class cli(backend.Executioner):
 param.label, param.confirm
 )
 
-try:
-callbacks = cmd.get_callbacks('interactive_prompt')
-except AttributeError:
-pass
-else:
-for callback in callbacks:
-callback(cmd, kw)
-
 def load_files(self, cmd, kw):
 """
 Load files from File parameters.
-- 
1.8.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel