mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-30 09:36:41 +00:00
Merge pull request #6488 from gurevichmark/nodepurge
Remove /install/autoinst config files as part of nodepurge
This commit is contained in:
commit
80a559983c
@ -31,7 +31,7 @@ DESCRIPTION
|
||||
|
||||
The \ **nodepurge**\ automatically removes all nodes from the database and any related configurations used by the node.
|
||||
|
||||
After the nodes are removed, the configuration files related to these nodes are automatically updated, including the following files: /etc/hosts, DNS, DHCP. Any kits that are used by the nodes are triggered to automatically update kit configuration and services.
|
||||
After the nodes are removed, the configuration files related to these nodes are automatically updated, including the following files: \ */etc/hosts*\ , DNS, DHCP. Any kits that are used by the nodes are triggered to automatically update kit configuration and services. Any related configuration files from \ */install/autoinst*\ are also removed.
|
||||
|
||||
|
||||
*******
|
||||
@ -39,17 +39,11 @@ OPTIONS
|
||||
*******
|
||||
|
||||
|
||||
\ **-h|-**\ **-help**\
|
||||
\ **-h|-**\ **-help**\ Display usage message.
|
||||
|
||||
Display usage message.
|
||||
\ **-v|-**\ **-version**\ Command Version
|
||||
|
||||
\ **-v|-**\ **-version**\
|
||||
|
||||
Command Version
|
||||
|
||||
\ *noderange*\
|
||||
|
||||
The nodes to be removed.
|
||||
\ *noderange*\ The nodes to be removed.
|
||||
|
||||
|
||||
************
|
||||
@ -67,7 +61,7 @@ EXAMPLES
|
||||
********
|
||||
|
||||
|
||||
To remove nodes compute-000 and compute-001, use the following command:
|
||||
To remove nodes compute-000 and compute-001:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
@ -12,21 +12,15 @@ B<nodepurge> I<noderange>
|
||||
|
||||
The B<nodepurge> automatically removes all nodes from the database and any related configurations used by the node.
|
||||
|
||||
After the nodes are removed, the configuration files related to these nodes are automatically updated, including the following files: /etc/hosts, DNS, DHCP. Any kits that are used by the nodes are triggered to automatically update kit configuration and services.
|
||||
After the nodes are removed, the configuration files related to these nodes are automatically updated, including the following files: I</etc/hosts>, DNS, DHCP. Any kits that are used by the nodes are triggered to automatically update kit configuration and services. Any related configuration files from I</install/autoinst> are also removed.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
B<-h|--help> Display usage message.
|
||||
|
||||
Display usage message.
|
||||
B<-v|--version> Command Version
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version
|
||||
|
||||
I<noderange>
|
||||
|
||||
The nodes to be removed.
|
||||
I<noderange> The nodes to be removed.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
@ -36,7 +30,7 @@ The nodes to be removed.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
To remove nodes compute-000 and compute-001, use the following command:
|
||||
To remove nodes compute-000 and compute-001:
|
||||
|
||||
nodepurge compute-000,compute-001
|
||||
|
||||
|
@ -687,7 +687,7 @@ sub nodepurge {
|
||||
Usage:
|
||||
\tnodepurge <noderange>
|
||||
\tnodepurge [-h|--help]
|
||||
\tnodepurge {-v|--version}";
|
||||
\tnodepurge [-v|--version]";
|
||||
|
||||
my $ret = validate_args($helpmsg);
|
||||
if (!$ret) {
|
||||
@ -735,6 +735,20 @@ Usage:
|
||||
$warnstr .= "Details: $retstrref->[1]";
|
||||
}
|
||||
}
|
||||
# For each node in the noderange remove its configureation files in $config_dir, if file exists
|
||||
setrsp_progress("Removing configuration files...");
|
||||
my $config_dir = "/install/autoinst/";
|
||||
foreach my $one_node (@$nodes) {
|
||||
if ( -e "$config_dir/$one_node") {
|
||||
unlink "$config_dir/$one_node";
|
||||
}
|
||||
if ( -e "$config_dir/$one_node.post") {
|
||||
unlink "$config_dir/$one_node.post";
|
||||
}
|
||||
if ( -e "$config_dir/$one_node.pre") {
|
||||
unlink "$config_dir/$one_node.pre";
|
||||
}
|
||||
}
|
||||
setrsp_progress("Removed all nodes.");
|
||||
setrsp_success($nodes, $warnstr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user