[yast-devel] YCP exit code
Hi, Is it possible to return an exit code from a YCP module? I've tried returning a value from the top level block but exit code always remains 0. Use case: I would like to return a value from a module running as root to one not running as root. Thanks in advance. _ Benjamin Weber -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Tue, Apr 10, 2007 at 08:39:46PM +0100, Benji Weber wrote:
Hi,
Is it possible to return an exit code from a YCP module? I've tried returning a value from the top level block but exit code always remains 0.
That should be possible, but only as a boolean information: In core/liby2/src/genericfrontend.cc line 557 you can see that it's possible to return an exit code for success and failure. Your module must return a boolean and depending on that y2base will exit with 0 or 16 (YCP_ERROR). ciao Arvin -- Arvin Schnell, <aschnell@suse.de> Software Engineer, Research & Development SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
In 4/11/07, Arvin Schnell <aschnell@suse.de> wrote:
On Tue, Apr 10, 2007 at 08:39:46PM +0100, Benji Weber wrote:
Hi,
Is it possible to return an exit code from a YCP module? I've tried returning a value from the top level block but exit code always remains 0.
That should be possible, but only as a boolean information: In core/liby2/src/genericfrontend.cc line 557 you can see that it's possible to return an exit code for success and failure. Your module must return a boolean and depending on that y2base will exit with 0 or 16 (YCP_ERROR).
Thanks for this, It does indeed work when running with y2base directly. The /sbin/YaST[2] scripts don't exit with the same exit code as y2base. _ Benjamin Weber -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Dňa St 11. Apríl 2007 10:38 Benji Weber napísal:
In 4/11/07, Arvin Schnell <aschnell@suse.de> wrote:
On Tue, Apr 10, 2007 at 08:39:46PM +0100, Benji Weber wrote:
Hi,
Is it possible to return an exit code from a YCP module? I've tried returning a value from the top level block but exit code always remains 0.
That should be possible, but only as a boolean information: In core/liby2/src/genericfrontend.cc line 557 you can see that it's possible to return an exit code for success and failure. Your module must return a boolean and depending on that y2base will exit with 0 or 16 (YCP_ERROR).
Thanks for this, It does indeed work when running with y2base directly. The /sbin/YaST[2] scripts don't exit with the same exit code as y2base.
I think this is worth a bug report. Stano -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (3)
-
Arvin Schnell
-
Benji Weber
-
Stanislav Visnovsky