r1922 - various updates to wwnvfs.

12 views
Skip to first unread message

com...@warewulf.lbl.gov

unread,
Jun 23, 2015, 2:00:57 PM6/23/15
to warewul...@lbl.gov
Author: gmk
Date: 2015-06-23 11:00:51 -0700 (Tue, 23 Jun 2015)
New Revision: 1922

Modified:
trunk/vnfs/bin/wwvnfs
Log:
various updates to wwnvfs.


Modified: trunk/vnfs/bin/wwvnfs
===================================================================
--- trunk/vnfs/bin/wwvnfs 2015-06-19 21:52:15 UTC (rev 1921)
+++ trunk/vnfs/bin/wwvnfs 2015-06-23 18:00:51 UTC (rev 1922)
@@ -56,7 +56,6 @@
my $opt_hybridizefile;
my $opt_includefile;
my $opt_hybrid;
-my $opt_yes;
my @exclude_files;
my @hybridize_files;
my %exclude_map;
@@ -65,7 +64,6 @@
my $wwsh_bin;
my $create_config;
my $file_pipe;
-my $cpio_time;
my $gzip_pipe;


@@ -89,7 +87,6 @@
'hybridizefile=s' => \$opt_hybridizefile,
'includefile=s' => \$opt_includefile,
'hybridpath=s' => \$opt_hybrid,
- 'y|yes' => \$opt_yes
);

&set_log_level("NOTICE");
@@ -119,7 +116,6 @@
print " be hybridized from the VNFS image\n";
print " --hybridpath Path to use within the VNFS where the links will be pointed to in\n";
print " the final image (this needs to be added to the VNFS fstab!)\n";
- print " -y, --yes Skips yes/no prompt if you're importing into an existing VNFS\n";
print "\nNOTES:\n\n";
print " When wwvnfs is run for the first time on a VNFS, it will attempt to create a\n";
print " configuration file in the default warewulf config dir ($sysconfdir/warewulf/vnfs/) or in\n";
@@ -383,7 +379,7 @@

# Build the hybridization component of the CPIO (not using a temporary
# directory, writing CPIO format directly)
- &nprint("Compiling hybridization link tree\n");
+ &nprint(sprintf("%-60s: ", "Compiling hybridization link tree"));
my $count = 1;
my $current_time = time();
foreach my $p ( keys %hybridize_map ) {
@@ -411,21 +407,25 @@
$count++;
}

- &nprint("Building file list\n");

+ &nprint($timer->mark() ." s\n");
+
+ &nprint(sprintf("%-60s: ", "Building file list"));
+
# Building list of files to archive into CPIO
open($filepipe, "> $tmpfile");
find({ wanted => \&vnfs_create_file, no_chdir => 1}, $opt_chroot);
close $filepipe;

- &nprint("Compiling and compressing VNFS\n");
+ &nprint($timer->mark() ." s\n");
+
+ &nprint(sprintf("%-60s: ", "Compiling and compressing VNFS"));
# Changing directory and calling CPIO
chdir($opt_chroot);
open($cpio_pipe, "cat $tmpfile | cpio --quiet -o -H newc |");

# Pulling the CPIO output from the above process and running it through
# the existing gzip pipe.
- &iprint("Waiting for GZIP to complete...\n");
while (<$cpio_pipe>) {
print $gzip_pipe $_;
}
@@ -436,7 +436,7 @@
}

unlink($tmpfile);
- $cpio_time = $timer->mark();
+ &nprint($timer->mark() ." s\n");

if (-f $gzip_output) {
if ($opt_output) {
@@ -455,13 +455,11 @@
&eprint("$!\n");
}
} else {
- if ($opt_yes) {
- system("yes | $wwsh_bin vnfs import $gzip_output --chroot='$opt_chroot' --name='$opt_name'");
- } else {
- system("$wwsh_bin vnfs import $gzip_output --chroot='$opt_chroot' --name='$opt_name'");
- }
+ &nprint(sprintf("%-60s: ", "Adding image to datastore"));
+ #system("yes | $wwsh_bin vnfs import $gzip_output --chroot='$opt_chroot' --name='$opt_name'");
+ system("$wwsh_bin -yq vnfs import $gzip_output --chroot='$opt_chroot' --name='$opt_name'");
unlink($gzip_output);
- &nprint("Done.\n");
+ &nprint($timer->mark() ." s\n");
}
} else {
&eprint("There was an uncaught error creating the VNFS at $gzip_output!\n");
@@ -476,10 +474,7 @@
exit 1;
}

-&nprint("Time to build VNFS: $cpio_time s\n");
-&nprint("Total elapsed time: ". $timer->elapsed() ." s\n");

-
if ($create_config) {
my $config_path;
my $config_fh;
@@ -570,5 +565,11 @@
}
}

+
+&nprint(sprintf("%-60s: ", "Total elapsed time"));
+&nprint($timer->elapsed() ." s\n");
+
+
+
# vim:filetype=perl:syntax=perl:expandtab:ts=4:sw=4:


Jason Stover

unread,
Apr 14, 2016, 10:13:22 PM4/14/16
to warewul...@lbl.gov
So, just noticed this when using an updated trunk version ...

Is there a reason that the "ask" was removed and changed to just
overwriting a VNFS if it already exists?

-J
> To unsubscribe from this group and stop receiving emails from it, send an email to warewulf-deve...@lbl.gov.

Gregory M. Kurtzer

unread,
Apr 15, 2016, 1:26:52 PM4/15/16
to warewul...@lbl.gov
It was annoying me. Lol

It is silly to start the process, wait (many times minutes for it to complete) and then not say yes to finish the task when they could have ctrl-c'ed at any point to abandon the update.


Sent from my iPhone

Allen, Benjamin S.

unread,
Apr 15, 2016, 2:22:32 PM4/15/16
to warewul...@lbl.gov
Perhaps it would make more sense to still have the prompt but check upfront if it is going to overwrite an existing VNFS and prompt immediately.

Ben
> --
> You received this message because you are subscribed to the Google Groups "Warewulf-devel" group.
Reply all
Reply to author
Forward
0 new messages