diff --git a/utils/getimages.in b/utils/getimages.in index 7aecf84fead8a3be50daaac99fddbb3dd0c8997d..4abcfaee133ccab6db8cdb28fb2adb43ad672b38 100755 --- a/utils/getimages.in +++ b/utils/getimages.in @@ -1,6 +1,6 @@ #!/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 # @@ -252,10 +252,13 @@ foreach my $imageid (keys(%{ $xmlparse->{'image'} })) { # Do this as admin cause of admin only options in the descriptor. system("$SUDO -u $PROTOUSER $WAP $NEWIMAGE_EZ -a $metafilename") == 0 or fatal("Could not create descriptor for $imageid"); - } - $image = Image->Lookup(TBOPSPID(), $imageid); - if (!defined($image)) { - fatal("Could not lookup newly created descriptor for $imageid"); + + $image = Image->Lookup(TBOPSPID(), $imageid); + if (!defined($image)) { + fatal("Could not lookup newly created descriptor for $imageid"); + } + $image->MarkReady(); + $image->MarkReleased(); } my $imagefilename = "$TB/images/${imageid}.ndz"; diff --git a/utils/image_import.in b/utils/image_import.in index e685495075c5a9311de8901e41d1aaabe9ce9a31..6f696be07afaddf6444d1a47e3dfe504c5aac1d0 100644 --- a/utils/image_import.in +++ b/utils/image_import.in @@ -389,6 +389,8 @@ sub CreateImage($$$$) if (!defined($image)) { fatal("Could not lookup new image for $url"); } + $image->MarkReady(); + $image->MarkReleased(); return $image; }