Commit 3027b03f authored by Leigh B Stoller's avatar Leigh B Stoller

When importing images, set the ready/released bits.

parent 50b9ffde
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2003-2013 University of Utah and the Flux Group. # Copyright (c) 2003-2014 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -252,10 +252,13 @@ foreach my $imageid (keys(%{ $xmlparse->{'image'} })) { ...@@ -252,10 +252,13 @@ foreach my $imageid (keys(%{ $xmlparse->{'image'} })) {
# Do this as admin cause of admin only options in the descriptor. # Do this as admin cause of admin only options in the descriptor.
system("$SUDO -u $PROTOUSER $WAP $NEWIMAGE_EZ -a $metafilename") == 0 system("$SUDO -u $PROTOUSER $WAP $NEWIMAGE_EZ -a $metafilename") == 0
or fatal("Could not create descriptor for $imageid"); or fatal("Could not create descriptor for $imageid");
}
$image = Image->Lookup(TBOPSPID(), $imageid); $image = Image->Lookup(TBOPSPID(), $imageid);
if (!defined($image)) { if (!defined($image)) {
fatal("Could not lookup newly created descriptor for $imageid"); fatal("Could not lookup newly created descriptor for $imageid");
}
$image->MarkReady();
$image->MarkReleased();
} }
my $imagefilename = "$TB/images/${imageid}.ndz"; my $imagefilename = "$TB/images/${imageid}.ndz";
......
...@@ -389,6 +389,8 @@ sub CreateImage($$$$) ...@@ -389,6 +389,8 @@ sub CreateImage($$$$)
if (!defined($image)) { if (!defined($image)) {
fatal("Could not lookup new image for $url"); fatal("Could not lookup new image for $url");
} }
$image->MarkReady();
$image->MarkReleased();
return $image; return $image;
} }
......
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