Commit 662700ba authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Addition option to Image->AllVersions(); flag to include deleted

versions of the image, which is certain contexts is needed.
parent 2a3fc590
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2010-2016 University of Utah and the Flux Group. # Copyright (c) 2010-2017 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -236,6 +236,11 @@ sub DumpImage($) ...@@ -236,6 +236,11 @@ sub DumpImage($)
$xmlfields{'origin_urn'} = $xmlfields{'origin_urn'} =
GeniHRN::Generate($OURDOMAIN, "authority", "cm"); GeniHRN::Generate($OURDOMAIN, "authority", "cm");
} }
# Send the architecture if it is set here.
if ($image->architecture()) {
$xmlfields{'architecture'} = $image->architecture();
}
# #
# Send along the history so that the caller can get all # Send along the history so that the caller can get all
# the versions, which is important for delta based images. # the versions, which is important for delta based images.
...@@ -279,7 +284,7 @@ sub DumpImage($) ...@@ -279,7 +284,7 @@ sub DumpImage($)
my @tmp; my @tmp;
# This returns a reverse ordered list. # This returns a reverse ordered list.
if ($image->AllVersions(\@tmp)) { if ($image->AllVersions(\@tmp, 1)) {
fatal("Could not get image version list"); fatal("Could not get image version list");
} }
# #
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2016 University of Utah and the Flux Group. # Copyright (c) 2016, 2017 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -207,7 +207,7 @@ sub doimage($) ...@@ -207,7 +207,7 @@ sub doimage($)
# Returned list is ordered highest to lowest version. # Returned list is ordered highest to lowest version.
# #
my @iversions; my @iversions;
$image->AllVersions(\@iversions); $image->AllVersions(\@iversions, 1);
# Get the canonical name, sans version, for reporting. # Get the canonical name, sans version, for reporting.
my $iname = $image->pid() . "/" . $image->imagename(); my $iname = $image->pid() . "/" . $image->imagename();
......
...@@ -128,7 +128,7 @@ sub ConvertImage($) ...@@ -128,7 +128,7 @@ sub ConvertImage($)
return 0; return 0;
} }
my @images = (); my @images = ();
if ($image->AllVersions(\@images)) { if ($image->AllVersions(\@images, 1)) {
print STDERR "Could not get list of (versions) for $image\n"; print STDERR "Could not get list of (versions) for $image\n";
return -1; return -1;
} }
......
...@@ -436,7 +436,7 @@ sub getallversions($) ...@@ -436,7 +436,7 @@ sub getallversions($)
my $headvers = $image->version(); my $headvers = $image->version();
my @iversions; my @iversions;
$image->AllVersions(\@iversions); $image->AllVersions(\@iversions, 1);
# Get the canonical name, sans version, for reporting. # Get the canonical name, sans version, for reporting.
my $iname = $image->pid() . "/" . $image->imagename(); my $iname = $image->pid() . "/" . $image->imagename();
......
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