I need help on configuring the brocade switch,I am able to execute simple commands to check the config,but I fail when their is some interactive options,like I have to save the config on the switch by passing yes or y to save it

the code is here below

$logger->info("create zone on the switch $ip using zonecreate"); ($out,$err) = $ssh->capture2("zonecreate \"test1\", \"20:00:00:11:0d:3 +4:56:00\""); $ssh->error and die "remote find command failed: $!" . $ssh->error; ($out,$err)=$ssh->capture2("zoneshow"); ($out,$err) = $ssh->capture2("cfgadd \"FC_DVT\", \"test1\""); $ssh->error and die "remote find command failed: $!" . $ssh->error; ($out,$err) = $ssh->capture2("{stdin_data =>yes},cfgsave"); $ssh->error and die "remote find command failed: $!" . $ssh->error;

switch commands should execute as follows

DS_6505B:admin> zonecreate "test1","20:00:00:11:0d:34:56:00" DS_6505B:admin> cfgadd "FC_DVT","test1" DS_6505B:admin> cfgsave WARNING!!! The changes you are attempting to save will render the Effective configuration and the Defined configuration inconsistent. The inconsistency will result in different Effective Zoning configurations for switches in the fabric if a zone merge or HA failover happens. To avoid inconsistency it is recommended to commit the configurations using the 'cfgenable' command. Do you want to proceed with saving the Defined zoning configuration only? (yes, y, no, n): [no] y Updating flash ... DS_6505B:admin> cfgenable FC_DVT You are about to enable a new zoning configuration. This action will replace the old zoning configuration with the current configuration selected. If the update includes changes to one or more traffic isolation zones, the update may result in localized disruption to traffic on ports associated with the traffic isolation zone changes Do you want to enable 'FC_DVT' configuration (yes, y, no, n): [no] y zone config "FC_DVT" is in effect Updating flash ...

Iam having issue in executing the above commands

the error i get when i run is like this, 2015/07/28 04:10:31 zoneshow successful 2015/07/28 04:10:34 create zone on the switch 10.227.0.216 using zonec +reate remote find command failed: child exited with code 1 at ./switchconfig +.pl line 113, <$fh> line 4.

In reply to issue with code to save config on brocade switch by janasec

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.