Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316168 Details for
Bug 446593
FEAT: HwCert catalog should reject results from testing versions of HTS
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Improve: sanitycheck_hts_version.pl
sanitycheck_hts_version.pl (text/plain), 3.76 KB, created by
XINSUN
on 2008-09-09 10:11:30 UTC
(
hide
)
Description:
Improve: sanitycheck_hts_version.pl
Filename:
MIME Type:
Creator:
XINSUN
Created:
2008-09-09 10:11:30 UTC
Size:
3.76 KB
patch
obsolete
>#!/usr/bin/perl -w ># -*- Mode: perl; indent-tabs-mode: nil -*- ># ># The contents of this file are subject to the Mozilla Public ># License Version 1.1 (the "License"); you may not use this file ># except in compliance with the License. You may obtain a copy of ># the License at http://www.mozilla.org/MPL/ ># ># Software distributed under the License is distributed on an "AS ># IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or ># implied. See the License for the specific language governing ># rights and limitations under the License. ># ># The Original Code is the Bugzilla Bug Tracking System. ># ># The Initial Developer of the Original Code is Netscape Communications ># Corporation. Portions created by Netscape are ># Copyright (C) 1998 Netscape Communications Corporation. All ># Rights Reserved. ># ># Contributor(s): Terry Weissman <terry@mozilla.org> ># Joseph Heenan <joseph@heenan.me.uk> > > ># This is a script suitable for running once a day from a cron job. It ># does a sanitycheck for hts version to ensure the old version expired ># after the next new version was public over 3 month (92 days). ># When this script set a hts version expired, it will sent a notice mail. > ># Modified from whineatnews.pl by Sun Xin <xisun@redhat.com> > >use strict; > >use lib "."; >require "globals.pl"; > >use Bugzilla; >use Bugzilla::Config qw(:DEFAULT $datadir); > >my $transition_period = 92; >my $next_release_date; >my $count = 0; > >my $query = "SELECT NVR, release_date > FROM hts_version > WHERE supported = 1 > ORDER BY release_date DESC"; >SendSQL2($query); > >while (MoreSQLData2()) { > my ($nvr,$release_date) = FetchSQLData2(); > if ($count > 0) { > my $dbh = Bugzilla->dbh2; > $query = "SELECT (TO_DAYS(NOW()) - TO_DAYS(" . SqlQuote($next_release_date) . "))"; > my $sth = $dbh->prepare($query); > $sth->execute(); > my ($passed_period) = $sth->fetchrow_array(); > if ($passed_period == 30 || $passed_period == 60) { > #Send the warning notice mail that version will expire when 30 or 60 days passed. > my $enablemail = Param('enablemail'); > if ($enablemail) { > my $template = Param('htsversionwarningmail'); > my %substs; > $substs{'expiringhtsnvr'} = $nvr; > $query = "SELECT DATE(DATE_ADD(" . SqlQuote($next_release_date) . ", INTERVAL $transition_period DAY))"; > $sth = $dbh->prepare($query); > $sth->execute(); > $substs{'expiredate'} = $sth->fetchrow_array(); > my $msg = PerformSubsts($template, \%substs); > my $sendmailparam = Param('sendmailnow') ? '' : "-ODeliveryMode=deferred"; > open SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i" > or die "Can't open sendmail"; > print SENDMAIL $msg; > close SENDMAIL; > } > } elsif ($passed_period > $transition_period) { > $query = "UPDATE hts_version SET supported = 0 WHERE NVR = " . SqlQuote($nvr) . " AND supported = 1"; > $dbh->do($query); > #Send HTS version expired notifice mail. > my $enablemail = Param('enablemail'); > if ($enablemail) { > my $template = Param('htsversionexpiredmail'); > my %substs; > $substs{'expiredhtsnvr'} = $nvr; > my $msg = PerformSubsts($template, \%substs); > my $sendmailparam = Param('sendmailnow') ? '' : "-ODeliveryMode=deferred"; > open SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t -i" > or die "Can't open sendmail"; > print SENDMAIL $msg; > close SENDMAIL; > } > } > } > $next_release_date = $release_date; > $count = $count + 1; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 446593
:
315671
|
315672
|
315825
|
315833
|
315834
|
316167
| 316168