Skip to content

hostconfig: Use make_path to create possible non-existing directory /node #184

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hostconfig/hostconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ sub evalue_expression {
sub populate_node {
my ($hostname)=@_;
my $DIR='/node/tags';
-d $DIR and system "rm -rf $DIR" and exit 1;
mkdir $DIR or die "$DIR: $!\n";
-d $DIR and system 'rm', '-rf', $DIR and exit 1;
system 'mkdir', '-p', $DIR and exit 1;
my $tags=$TAGS{$hostname};
for (keys %$tags) {
open my $touch,'>',"$DIR/$_";
Expand Down