Commit d179740f authored by Leigh Stoller's avatar Leigh Stoller

Add missing "mfs" flag to newosid and dumpdescriptor. Not sure when

this got dropped, but I guess we do not make these very often. But I
need it to work for the new version of load-descriptors on a new
installation.
parent f135521c
......@@ -139,6 +139,7 @@ my %xmlfields =
"magic", => ["magic", $SLOT_OPTIONAL, ""],
"op_mode", => ["op_mode", $SLOT_REQUIRED],
"features", => ["osfeatures", $SLOT_OPTIONAL, ""],
"mfs", => ["mfs", $SLOT_ADMINONLY, 0],
"shared", => ["shared", $SLOT_ADMINONLY, 0],
"mustclean", => ["mustclean", $SLOT_ADMINONLY, 1],
"nextosid", => ["nextosid", $SLOT_ADMINONLY],
......
......@@ -15,15 +15,17 @@ use strict;
#
sub usage()
{
print STDERR "Usage: dump-descriptors [-v vers] filename\n";
print STDERR "Usage: dump-descriptors [-v vers] [-m] filename\n";
print STDERR " -m dump just the MFS descriptors.\n";
print STDERR " -v 1 first generation STD images (FBSD410, RHL90)\n";
print STDERR " -v 2 second generation STD images (FBSD62, FC6)\n";
print STDERR "Default version is 1.\n";
exit(-1);
}
my $optlist = "v:";
my $optlist = "v:m";
my $version = 1;
my $mfsonly = 0;
#
# These are the images/osids we dump out. We of course get the embedded osids.
......@@ -109,7 +111,11 @@ if (defined($options{"v"})) {
}
$version = $vers;
}
if (defined($options{"m"})) {
$mfsonly = 1;
%mappings = ();
%imagenames = ();
}
usage()
if (@ARGV != 1);
my $filename = $ARGV[0];
......@@ -189,6 +195,8 @@ foreach my $osid (keys(%osinfos)) {
next
if ($osinfo->ezid());
next
if ($mfsonly && !$osinfo->mfs());
system("$DUMPDESC -o $osid >> $filename") == 0
or fatal("Could not dump $osinfo");
......
......@@ -178,6 +178,7 @@ sub DumpOS($)
$xmlfields{"features"} = $osinfo->osfeatures()
if (defined($osinfo->osfeatures()) && $osinfo->osfeatures() ne "");
$xmlfields{"shared"} = $osinfo->shared();
$xmlfields{"mfs"} = $osinfo->mfs() if ($osinfo->mfs());
$xmlfields{"mustclean"} = $osinfo->mustclean();
$xmlfields{"reboot_waittime"} = $osinfo->reboot_waittime()
if (defined($osinfo->reboot_waittime()));
......
......@@ -164,6 +164,17 @@ if ($isadmin) {
'#label' => 'Global?',
'#checkslot' => 'os_info:shared',
'#description' => 'available to all projects');
#
# MFS?
#
$fields['mfs'] =
array('#type' => 'checkbox',
'#return_value'=> 1,
'#label' => 'MFS?',
'#checkslot' => 'os_info:mfs',
'#description' => 'this OS is an MFS');
#
# Mustclean?
#
......@@ -236,6 +247,7 @@ if (!isset($submit)) {
$defaults["path"] = "";
$defaults["magic"] = "";
$defaults["shared"] = 0;
$defaults["mfs"] = 0;
$defaults["mustclean"] = 0;
$defaults["path"] = "";
$defaults["op_mode"] = TBDB_DEFAULT_OSID_OPMODE;
......
......@@ -291,6 +291,7 @@ class OSinfo
$reboot_waittime= $this->reboot_waittime();
$uuid = $this->uuid();
$ezid = $this->ezid();
$mfs = $this->mfs();
if (! ($creator_user = User::Lookup($creator))) {
TBERROR("Error getting object for user $creator", 1);
......@@ -421,6 +422,12 @@ class OSinfo
$os_osname</a></td>
</tr>\n";
}
if ($mfs) {
echo "<tr>
<td>MFS: </td>
<td class=left>Yes</td>
</tr>\n";
}
echo "<tr>
<td>Internal ID: </td>
......
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