Subject: | cmd always returns false exit status |
Date: | Fri, 13 Feb 2015 11:49:30 -0500 |
To: | <bug-Control-CLI-AvayaData [...] rt.cpan.org> |
From: | Jay Turner <jturner [...] corp.iixpeering.net> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Control-CLI-AvayaData-1.00
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
# uname -a
Linux localhost.localdomain 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15
04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Not sure if it is the switches I'm working with or something else
happening, but all 'cmd' calls exit with code 0, even when successful.
Case in point, executing the example code from the CPAN page:
$cli->enable;
$cli->return_result(1);
$cli->cmd('config terminal') or die $cli->last_cmd_errmsg;
$cli->cmd('no banner') or die $cli->last_cmd_errmsg;
$cli->cmd('exit') or die $cli->last_cmd_errmsg;
$cli->return_result(0);
$cli->device_more_paging(0);
$config = $cli->cmd('show running-config');
print $config;
$cli->disconnect;
Will result in all of the 'die' options being executed. Yet all of
the commands are actually succeeding.
Thanks!
- - jkt
- --
Jay Turner, Director, CloudRouter DevOps, IIX Inc.
✉ jturner@iix.net ☎: +1-919-633-0619
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iEYEARECAAYFAlTeKxoACgkQA/BpaFGKSrwSDwCeNJpgBh07/q3Cb0DiXh7xHAb9
qrMAn3PqZiiYYFwRSH+QKJp6y87oNV3z
=ANYr
-----END PGP SIGNATURE-----