Commit 3029a212 authored by Leigh B Stoller's avatar Leigh B Stoller

Do not report imported system images.

parent 756834a5
...@@ -41,14 +41,13 @@ sub usage() ...@@ -41,14 +41,13 @@ sub usage()
print "Usage: postimagedata [-f] [-n] [-d] [-a] all | [imageid ...]\n"; print "Usage: postimagedata [-f] [-n] [-d] [-a] all | [imageid ...]\n";
exit(1); exit(1);
} }
my $optlist = "fndvsa"; my $optlist = "fndva";
my $impotent = 0; my $impotent = 0;
my $force = 0; my $force = 0;
my $debug = 0; my $debug = 0;
my $verbose = 0; my $verbose = 0;
my $errors = 0; my $errors = 0;
my $allvers = 0; my $allvers = 0;
my $system = 0;
# #
# Configure variables # Configure variables
...@@ -130,9 +129,6 @@ if (defined($options{"d"})) { ...@@ -130,9 +129,6 @@ if (defined($options{"d"})) {
if (defined($options{"v"})) { if (defined($options{"v"})) {
$verbose = 1; $verbose = 1;
} }
if (defined($options{"s"})) {
$system = 1;
}
usage() usage()
if (!@ARGV); if (!@ARGV);
# Avoid mistakes, force caller to say they want all images posted. # Avoid mistakes, force caller to say they want all images posted.
...@@ -193,10 +189,6 @@ else { ...@@ -193,10 +189,6 @@ else {
# Force allows updating all images previously reported # Force allows updating all images previously reported
my $ims_reported_clause = my $ims_reported_clause =
($force ? "1 or" : "ims_reported is null or"); ($force ? "1 or" : "ims_reported is null or");
# System allows reporting only system images.
my $only_system_clause =
($system ? "" :
" or (metadata_url is null and creator_urn is not null)");
# List of all images that have not been reported to the IMS. # List of all images that have not been reported to the IMS.
my $query_result = my $query_result =
...@@ -208,8 +200,9 @@ else { ...@@ -208,8 +200,9 @@ else {
" ims_noreport=0 and ". " ims_noreport=0 and ".
" origin_urn is null and ". " origin_urn is null and ".
" deleted is null and ". " deleted is null and ".
" ((v.pid='$TBOPSPID' and v.global=1) ". " metadata_url is null and ".
" $only_system_clause) and ". " (creator_urn is not null or ".
" (v.pid='$TBOPSPID' and v.global=1)) and ".
" ($ims_reported_clause ". " ($ims_reported_clause ".
" created > ims_reported or ". " created > ims_reported or ".
" updated > ims_reported) ". " updated > ims_reported) ".
......
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