Commit d29a817c authored by Leigh Stoller's avatar Leigh Stoller

Remove files that are not being worked on any more and probably never will.

parent dcaa0b59
#
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
# Copyright (c) 2000-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -99,7 +99,7 @@ WEB_BIN_SCRIPTS = webnscheck webendexp webtbreport webbatchexp \
LIBEXEC_STUFF = wanlinksolve wanlinkinfo os_setup mkexpdir console_setup \
assign_wrapper assign_wrapper2 os_setup_old \
assign_prepass ptopgen ptopgen_new \
assign_prepass ptopgen \
spewlogfile staticroutes routecalc wanassign \
switchmac spewrpmtar spewrpmtar_verify spewrpmtar_cgi \
webfrisbeekiller gentopofile \
......@@ -111,7 +111,7 @@ LIB_STUFF = libtbsetup.pm exitonwarn.pm libtestbed.pm \
libaudit.pm libreboot.pm libosload.pm libtestbed.py \
libadminmfs.pm libtblog.pm libtblog_simple.pm libArchive.pm \
power_mail.pm power_whol.pm Template.pm power_rmcp.pm \
power_ilo.pm libvtop.pm libptop.pm libptop_new.pm \
power_ilo.pm libvtop.pm libptop.pm \
libossetup.pm \
power_ipmi.pm libosload_new.pm libosload_switch.pm \
libosload_ue.pm libossetup_switch.pm power_icebox.pm \
......
This diff is collapsed.
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
use strict;
use English;
use Getopt::Std;
use lib "@prefix@/lib";
use libdb;
use emdbi;
use libptop_new;
use GeniXML;
sub usage();
sub processArgs();
sub consultDatabase();
sub process();
sub printResults();
sub printTypeLimits($);
#
# Turn off line buffering on output
#
$| = 1;
my $print_xml = 0;
my $print_ns = $GeniXML::RSPEC_2_NS;
my $typelimitfile;
my $debug = 0;
# Initialize permissions table for the current project
emdbi::ClearQueryCount();
processArgs();
consultDatabase();
printResults();
if ($debug) {
print STDERR "# of Queries: " . emdbi::GetQueryCount() . "\n";
}
sub usage()
{
print("Usage: ptopgen [-p pid [-e eid]] [-v] [-r] [-S] [-s switch]\n".
" [-h] [-a] [-m multiplex_factor] [-u] [-d]\n".
" [-c delay_capacity] [-x] [-g (0.1 | 0.2 | 2)]\n".
" [-l type-limit-file] [-1 component_name]\n\n" .
" -p User project. May restrict nodes and osids.\n".
" -e User experiment. Nodes and bandwidth allocated to\n" .
" this experiment are reported as free.\n" .
" -v Include virtual node types\n".
" -r Include widearea nodes\n".
" -S Include simulated node types and flags\n".
" -s Switch to use (UNIMPLEMENTED)\n".
" -h Include shared nodes\n".
" -a Include reserved nodes\n".
" -m Override multiplex_factor\n".
" -u Prune unused interfaces of allocated nodes (-e)(UNIMPLEMENTED)\n".
" -d Debug mode prints any problems in the database".
" -c Override delay capacity\n".
" -x Output in an RSpec xml format\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" .
" -1 Print an rspec containing only the node component-name");
exit(-1);
}
sub processArgs()
{
#
# Parse command arguments. Once we return from getopts, all that should be
# left are the required arguments.
#
my $optlist = "p:e:vrSs:ham:udc:xg:l:1:C";
my %options = ();
if (! getopts($optlist, \%options)) {
usage();
}
if (@ARGV) {
usage();
}
if (defined($options{"s"})) {
die("-s (switchtouse) option is not implemented\n");
}
if (defined($options{"x"})) {
$print_xml = 1;
if (! $libptop_new::PGENISUPPORT) {
usage();
}
my $mode = $options{"g"};
if (defined($mode)) {
if ($mode eq "0.1") {
$print_ns = $GeniXML::RSPEC_0_1_NS;
} elsif ($mode eq "0.2") {
$print_ns = $GeniXML::RSPEC_0_2_NS;
} elsif ($mode eq "2") {
$print_ns = $GeniXML::RSPEC_2_NS;
} elsif ($mode eq "3") {
$print_ns = $GeniXML::RSPEC_3_NS;
} else {
usage();
}
}
}
if (defined($options{"l"})) {
$typelimitfile = $options{"l"};
}
if (defined($options{"d"})) {
$debug = 1;
}
libptop_new::ProcessArgs(\%options);
}
sub consultDatabase()
{
# Bulk lookup on nodes table
libptop_new::LookupNodes();
# Bulk lookup of permissions table for project
libptop_new::LookupPermissions();
# Bulk lookup of global usage counts for shared nodes
libptop_new::LookupGlobalCounts();
# Bulk lookup of node and node_type auxtypes
libptop_new::LookupAuxtypes();
# Bulk lookup of node and node_type features
libptop_new::LookupFeatures();
# Bulk lookup of osids for features and genimode
libptop_new::LookupOsids();
# Bulk lookup of interfaces
libptop_new::LookupInterfaces();
# Bulk lookup of wires
libptop_new::LookupLinks();
# Process each node adding ptypes and features
foreach my $current (values(%{ libptop_new::Nodes() })) {
if ($current->willPrint()) {
$current->processTypeFeatures();
$current->processSwitch();
$current->processLocal();
$current->processWidearea();
}
}
libptop_new::AddFakeNodes();
}
sub printResults()
{
my $doc = GeniXML::CreateDocument($print_ns, "rspec");
my $rspec = $doc->documentElement();
$rspec->setNamespace($GeniXML::XSI_NS, "xsi", 0);
if (! GeniXML::IsVersion0($rspec)) {
$rspec->setNamespace($GeniXML::EMULAB_NS, "emulab", 0);
my $ns = $GeniXML::RSPEC_2_NS;
my $emulabns = $GeniXML::EMULAB_NS;
my $emulaburl = "http://www.protogeni.net/resources/rspec/ext/emulab/1/ptop_extension.xsd";
$rspec->setAttributeNS($GeniXML::XSI_NS, "xsi:schemaLocation",
"$ns $ns/ad.xsd $emulabns $emulaburl");
# if (defined($MAINSITE) && $MAINSITE) {
# Add stitching namespace and schemaLocation
# }
}
$rspec->setAttribute("type", "advertisement");
my @times = gmtime(time());
my $generated = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
$times[5] + 1900, $times[4] + 1, $times[3],
$times[2], $times[1], $times[0]);
$rspec->setAttribute("generated", $generated);
my $expiration = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
$times[5] + 1900, $times[4] + 1, $times[3],
$times[2], $times[1], $times[0]);
if (GeniXML::IsVersion0($rspec)) {
$rspec->setAttribute("valid_until", $expiration);
} else {
$rspec->setAttribute("expires", $expiration);
}
foreach my $current (values(%{ libptop_new::Nodes() })) {
if ($current->willPrint()) {
if ($print_xml) {
$current->toXML($rspec);
} else {
print $current->toString()."\n";
}
}
}
foreach my $current (values(%{ libptop_new::Links() })) {
if ($current->willPrint()) {
if ($print_xml) {
$current->toXML($rspec);
} else {
print $current->toString()."\n";
}
}
}
printTypeLimits($rspec);
if ($print_xml) {
print GeniXML::Serialize($rspec, 1)."\n";
}
}
sub printTypeLimits($)
{
my ($rspec) = @_;
if (defined($typelimitfile)) {
open(TYPELIMIT, "<$typelimitfile") or
die("Count not open type limit file $typelimitfile\n");
my @typelimits = <TYPELIMIT>;
close(TYPELIMIT);
foreach my $line (@typelimits) {
chomp($line);
my ($typeclass, $count) = split(" ", $line);
if ($print_xml && ! GeniXML::IsVersion0($rspec)) {
my $limit = GeniXML::AddElement("set_type_limit", $rspec,
$GeniXML::EMULAB_NS);
GeniXML::SetText("typeclass", $limit, $typeclass);
GeniXML::SetText("count", $limit, $count);
} else {
print "set-type-limit $typeclass $count\n";
}
}
}
}
Markdown is supported
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