perl code of Deferred Firmware Update item
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12670 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -146,9 +146,9 @@ sub get_lic_filenames { | ||||
| 	#		return ("", "","", $msg, -1); | ||||
| 	#	} | ||||
| 	  } else { | ||||
| 		$msg = $msg . "Upgrade $mtms disruptively!"; | ||||
|            if($activate ne "disruptive") { | ||||
| 	    		$msg = "Option --activate's value shouldn't be concurrent, and it must be disruptive"; | ||||
| 		$msg = $msg . "Upgrade $mtms!"; | ||||
|            if($activate !~ /^(disruptive|deferred)$/ { | ||||
| 	    		$msg = "Option --activate's value shouldn't be $activate, and it must be disruptive or deferred"; | ||||
| 			return ("", "","", $msg, -1); | ||||
| 		} | ||||
|        	 }  | ||||
| @@ -261,7 +261,7 @@ sub rflash { | ||||
| 	       	 | ||||
| 	        my $frame = $$d[5]; | ||||
|                 my $type = xCAT::DBobjUtils->getnodetype($frame); | ||||
|                 if ( ( $frame ne $name ) && ( $type eq "frame" ) ){ | ||||
|                 if ( ( $frame ne $name ) && ( $type eq "frame" ) && $activate !~ /^deferred$/){ | ||||
|                      | ||||
|                     my @frame_d = (0, 0, 0, $frame, "frame", 0); | ||||
| 	            $action = "list_firmware_level"; | ||||
| @@ -327,14 +327,15 @@ sub rflash { | ||||
|     	   | ||||
|            if($housekeeping =~ /^commit$/) { $action = "code_commit"} | ||||
|            if($housekeeping =~ /^recover$/) { $action = "code_reject"} | ||||
|            if($activate =~ /^disruptive$/) {  | ||||
|            if($housekeeping =~ /^bpa_acdl$/) { $action = "acdl"} | ||||
|            if($activate =~ /^(disruptive|deferred)$/) {  | ||||
|                $action = "code_update"; | ||||
|            } | ||||
|            if($activate =~ /^concurrent$/) { | ||||
|                my $res = "\'concurrent\' option not supported in FSPflash.Please use disruptive mode"; | ||||
|            } elsif (exists($activate)){ | ||||
|                #if($activate =~ /^concurrent$/) { | ||||
|                my $res = "\'$activate\' option not supported in FSPflash. Please use disruptive or deferred mode"; | ||||
|                push @value, [$name, $res, -1]; | ||||
| 	       next; | ||||
|           } | ||||
| 	           next; | ||||
|            } | ||||
| 	    | ||||
| 	   my $msg;	 | ||||
| 	   if(!defined($housekeeping)) {	    | ||||
|   | ||||
| @@ -94,7 +94,7 @@ sub parse_args { | ||||
|     $Getopt::Long::ignorecase = 0; | ||||
|     Getopt::Long::Configure( "bundling" ); | ||||
|  | ||||
|     if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s d=s activate=s commit recover) )) { | ||||
|     if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s d=s activate=s commit recover bpa_acdl) )) { | ||||
|         return( usage() ); | ||||
|     } | ||||
|      | ||||
| @@ -112,6 +112,11 @@ sub parse_args { | ||||
|     ################################# | ||||
|     #Option --activate not valid with --commit or --recover | ||||
|     ################################# | ||||
|     if (exists($opt{bpa_acdl}) && (exists($opt{activate}) || exists($opt{commit}) ||  | ||||
|                                    exists($opt{recover}) || exists($opt{p}) || exists($opt{d}))) { | ||||
|         return ( usage("Option --bpa_acdl not valid with other options ")); | ||||
|     } | ||||
|      | ||||
|     if( exists( $opt{activate} ) && (exists( $opt{commit}) || exists( $opt{recover}))) { | ||||
|         return( usage("Option --activate not valid with --commit or --recover ") ); | ||||
|     }     | ||||
| @@ -149,8 +154,8 @@ sub parse_args { | ||||
|     #--activate's value only can be concurrent and disruptive | ||||
|     ################################ | ||||
|     if(exists($opt{activate})) { | ||||
|         if( ($opt{activate} ne "concurrent") && ($opt{activate} ne "disruptive")) { | ||||
|             return (usage("--activate's value can only be concurrent or disruptive")); | ||||
|         if( ($opt{activate} ne "deferred") && ($opt{activate} ne "disruptive")) { | ||||
|             return (usage("--activate's value can only be deferred or disruptive")); | ||||
|         } | ||||
|  | ||||
|         if(!exists( $opt{d} )) { | ||||
| @@ -181,6 +186,9 @@ sub parse_args { | ||||
|     } elsif( defined( $opt{ recover }) ) { | ||||
|         print "recover flag\n"; | ||||
|         $housekeeping = "recover"; | ||||
|     } elsif (defined( $opt{ bpa_acdl})) { | ||||
|         print "bpa_acdl flag\n"; | ||||
|         $housekeeping = "bpa_acdl"; | ||||
|     } else { | ||||
|         print "no housekeeping - update mode\n"; | ||||
|         $housekeeping = undef; | ||||
| @@ -526,9 +534,9 @@ sub get_lic_filenames { | ||||
|     #        return ("", "","", $msg, -1); | ||||
|     #    } | ||||
|         } else { | ||||
|         $msg = $msg . "Upgrade $mtms disruptively!"; | ||||
|             if($activate ne "disruptive") { | ||||
|                 $msg = "Option --activate's value shouldn't be concurrent, and it must be disruptive"; | ||||
|         $msg = $msg . "Upgrade $mtms!"; | ||||
|             if($activate !~ /^(disruptive|deferred)$/) { | ||||
|                 $msg = "Option --activate's value shouldn't be $activate, and it must be disruptive or deferred"; | ||||
|                 return ("", "","", $msg, -1); | ||||
|             } | ||||
|         }  | ||||
|   | ||||
| @@ -268,8 +268,9 @@ my %usage = ( | ||||
| 	rflash <noderange> -p <rpm_directory> [--activate concurrent | disruptive][-V|--verbose]  | ||||
| 	rflash <noderange> [--commit | --recover] [-V|--verbose] | ||||
|     PPC (using Direct FSP Management) specific: | ||||
| 	rflash <noderange> -p <rpm_directory> --activate disruptive [-d <data_directory>] | ||||
| 	rflash <noderange> [--commit | --recover] [-V|--verbose]", | ||||
| 	rflash <noderange> -p <rpm_directory> --activate <disruptive|deferred> [-d <data_directory>] | ||||
| 	rflash <noderange> [--commit | --recover] [-V|--verbose] | ||||
|        rflash <noderange> [--bpa_acdl]", | ||||
|     "mkhwconn" => | ||||
| "Usage: | ||||
|     mkhwconn [-h|--help] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user