Skip to content
Jason Stover edited this page Mar 15, 2016 · 8 revisions

Testing by J

Just testing... Whee!

use Warewulf::Node;
my $n = Warewulf::Node->new();
$n->name("n0000");

print $n->name();

Fun and entertainment

Probably has more crap than needed in it... Meh.

use Warewulf::DataStore;
use Warewulf::Object;
use Warewulf::Node;
use Warewulf::Vnfs;
use Warewulf::File;
use Warewulf::DSO::File;
use Warewulf::Bootstrap;
use Warewulf::Provision;

my $ds = Warewulf::DataStore->new();
my $node = $ds->get_objects("node", "name", "n0123")->get_object(0);

print "Node: " . $node->nodename() . "\n";
print "VNFS: " . $node->vnfs() . "\n";
print "Bootstrap: " . $node->bootstrap() . "\n";
print "Kargs: " . join(" ", $node->kargs()) . "\n";
print "Preshell: " . ($node->preshell() ? "TRUE" : "FALSE") . "\n";
print "Postshell: " . ($node->postshell() ? "TRUE" : "FALSE") . "\n";
print "File IDs: " . join(",", $node->fileids()) . "\n";
print "Bootlocal: " . ($node->bootlocal() ? "TRUE" : "FALSE") . "\n";
#/usr/bin/perl -Tw

use Warewulf::DataStore;
use Warewulf::Object;
use Warewulf::Node;

my $ds = Warewulf::DataStore->new();

my $n = $ds->get_objects("node", "name", "n0123")->get_object(0);

print $n->nodename(), " eth0 gateway: ", $n->gateway("eth0"), "\n";
Clone this wiki locally