r4390 nxos4.connector: wait 60 seconds instead of default 10 when pushing save config...
authorAlexey Andriyanov <alan@al-an.info>
Fri, 25 Mar 2011 07:08:15 +0000 (07:08 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Fri, 25 Mar 2011 07:08:15 +0000 (07:08 +0000)
Nexus 7000 series saves its config for about 40 seconds.

gateways/deviceconfig/nxos4.connector

index aa4265b..3f90c13 100755 (executable)
@@ -93,7 +93,16 @@ if ($command eq "getlldpstatus") {
 if ($command eq "deploy") {
     open(WORKFILE, "<$workfile") || die "$workfile: $!";
     while (<WORKFILE>) {
-        $session->cmd($_);
+               my $prev_timeout;
+               if ($_ =~ /^copy running-config startup-config/) {
+                       $prev_timeout = $session->timeout(60);
+               }
+
+               $session->cmd($_);
+
+               if (defined $prev_timeout) {
+                       $session->timeout($prev_timeout);
+               }
     }
     exit(0);
 }