Commit 310c3956 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Added support for '-1' option to print out a single node in ptopgen_new

parent 7a528e68
...@@ -35,6 +35,7 @@ if ($PGENISUPPORT) { ...@@ -35,6 +35,7 @@ if ($PGENISUPPORT) {
@ISA = "Exporter"; @ISA = "Exporter";
@EXPORT = qw( ); @EXPORT = qw( );
my $single_node = undef;
my $user_project = undef; my $user_project = undef;
my $exempt_eid = undef; my $exempt_eid = undef;
my $available_only = 1; my $available_only = 1;
...@@ -127,6 +128,9 @@ sub ProcessArgs($) ...@@ -127,6 +128,9 @@ sub ProcessArgs($)
$print_shared = 1; $print_shared = 1;
$print_virtual = 1; $print_virtual = 1;
} }
if (defined($options{"1"})) {
$single_node = $options{"1"};
}
} }
# #
...@@ -902,6 +906,10 @@ sub willPrint($;$) ...@@ -902,6 +906,10 @@ sub willPrint($;$)
my ($self, $tagRef) = @_; my ($self, $tagRef) = @_;
my $node = $self->node(); my $node = $self->node();
if (defined($single_node)) {
return ($single_node eq $node->node_id());
}
# In geni mode, disallow nodes tagged protogeni_exclude from being printed. # In geni mode, disallow nodes tagged protogeni_exclude from being printed.
my $geniExclude = 0; my $geniExclude = 0;
$node->NodeAttribute("protogeni_exclude", \$geniExclude); $node->NodeAttribute("protogeni_exclude", \$geniExclude);
......
...@@ -55,12 +55,12 @@ sub usage() ...@@ -55,12 +55,12 @@ sub usage()
" -a Include reserved nodes\n". " -a Include reserved nodes\n".
" -m Override multiplex_factor\n". " -m Override multiplex_factor\n".
" -u Prune unused interfaces of allocated nodes (-e)(UNIMPLEMENTED)\n". " -u Prune unused interfaces of allocated nodes (-e)(UNIMPLEMENTED)\n".
" -d Debug mode -- prints to stderr any problems in the database". " -d Debug mode prints any problems in the database".
" -c Override delay capacity\n". " -c Override delay capacity\n".
" -x Output in an RSpec xml format\n". " -x Output in an RSpec xml format\n".
" -g version With -x, geni version. Must be '0.1', '0.2' or '2'\n". " -g version With -x, geni version. Must be '0.1', '0.2' or '2'\n".
" -l specifies the location of the type limit file\n" . " -l specifies the location of the type limit file\n" .
" -1 Print an rspec containing only the node component-name(UNIMPLEMENTED)"); " -1 Print an rspec containing only the node component-name");
exit(-1); exit(-1);
} }
...@@ -78,6 +78,9 @@ sub processArgs() ...@@ -78,6 +78,9 @@ sub processArgs()
if (@ARGV) { if (@ARGV) {
usage(); usage();
} }
if (defined($options{"s"})) {
die("-s (switchtouse) option is not implemented\n");
}
if (defined($options{"x"})) { if (defined($options{"x"})) {
$print_xml = 1; $print_xml = 1;
if (! $libptop_new::PGENISUPPORT) { if (! $libptop_new::PGENISUPPORT) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment