mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 13:22:36 +00:00 
			
		
		
		
	move --resetnet from lsslp to rspconfig
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9657 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -43,7 +43,8 @@ sub parse_args {
 | 
			
		||||
        "admin_passwd",
 | 
			
		||||
        "general_passwd",
 | 
			
		||||
        "*_passwd",
 | 
			
		||||
        "hostname"
 | 
			
		||||
        "hostname",
 | 
			
		||||
        "resetnet",
 | 
			
		||||
    );
 | 
			
		||||
    my @bpa = (
 | 
			
		||||
        "frame",
 | 
			
		||||
@@ -53,7 +54,8 @@ sub parse_args {
 | 
			
		||||
        "admin_passwd",
 | 
			
		||||
        "general_passwd",
 | 
			
		||||
        "*_passwd",
 | 
			
		||||
        "hostname"
 | 
			
		||||
        "hostname",
 | 
			
		||||
        "resetnet",
 | 
			
		||||
    );
 | 
			
		||||
    my @ppc = (
 | 
			
		||||
        "sshcfg"
 | 
			
		||||
@@ -108,7 +110,7 @@ sub parse_args {
 | 
			
		||||
    Getopt::Long::Configure( "bundling" );
 | 
			
		||||
    $request->{method} = undef;
 | 
			
		||||
 | 
			
		||||
    if ( !GetOptions( \%opt, qw(V|Verbose) )) {
 | 
			
		||||
    if ( !GetOptions( \%opt, qw(V|Verbose resetnet))) {
 | 
			
		||||
        return( usage() );
 | 
			
		||||
    }
 | 
			
		||||
    ####################################
 | 
			
		||||
@@ -128,7 +130,7 @@ sub parse_args {
 | 
			
		||||
    ####################################
 | 
			
		||||
    foreach my $arg ( @ARGV ) {
 | 
			
		||||
        my ($command,$value) = split( /=/, $arg );
 | 
			
		||||
        if ( !grep( /^$command$/, @$supported )) {
 | 
			
		||||
        if ( !grep( /^$command$/, @$supported) and !$opt{resetnet}) {
 | 
			
		||||
            return(usage( "Invalid command: $arg" ));
 | 
			
		||||
        } 
 | 
			
		||||
        if ( exists( $cmds{$command} )) {
 | 
			
		||||
@@ -163,6 +165,14 @@ sub parse_args {
 | 
			
		||||
        $request->{method} = "cfg";
 | 
			
		||||
        return( \%opt );
 | 
			
		||||
    }
 | 
			
		||||
    ####################################
 | 
			
		||||
    # Return method to invoke
 | 
			
		||||
    ####################################
 | 
			
		||||
    if ( $opt{resetnet}  ) {
 | 
			
		||||
        $request->{hcp} = "hmc";
 | 
			
		||||
        $request->{method} = "resetnet";
 | 
			
		||||
        return( \%opt );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ####################################
 | 
			
		||||
    # Return method to invoke
 | 
			
		||||
@@ -580,6 +590,20 @@ sub hostname {
 | 
			
		||||
 | 
			
		||||
    return( [@$result] );
 | 
			
		||||
}
 | 
			
		||||
##########################################################################
 | 
			
		||||
# Do resetnet 
 | 
			
		||||
##########################################################################
 | 
			
		||||
sub resetnet {
 | 
			
		||||
    my $request = shift;
 | 
			
		||||
    my $hash    = shift;
 | 
			
		||||
    my %nodehash;
 | 
			
		||||
    foreach ( @{$request->{noderange}}) {
 | 
			
		||||
       $nodehash{$_} = 1;
 | 
			
		||||
    }
 | 
			
		||||
    # go to use lsslp do_resetnet
 | 
			
		||||
    my $result = xCAT_plugin::lsslp::do_resetnet($request, \%nodehash);
 | 
			
		||||
	return [$result];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user