[freeside-commits] freeside/FS/FS Tron.pm,1.4,1.5
Ivan,,,
ivan at wavetail.420.am
Wed Jul 22 23:58:10 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv17623
Modified Files:
Tron.pm
Log Message:
need to see who is still on deb 4 & pg 7.4
Index: Tron.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Tron.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Tron.pm 14 Oct 2008 21:27:41 -0000 1.4
+++ Tron.pm 23 Jul 2009 06:58:08 -0000 1.5
@@ -9,34 +9,56 @@
use FS::svc_external;
use FS::cust_svc_option;
-our @EXPORT_OK = qw( tron_scan tron_lint);
+our @EXPORT_OK = qw( tron_ping tron_scan tron_lint);
our %desired = (
- #lenient for now, so we can fix up important stuff
+ #less lenient, we need to make sure we upgrade deb 4 & pg 7.4
'freeside_version' => qr/^1\.(7\.3|9\.0)/,
- 'debian_version' => qr/^4/,
+ 'debian_version' => qr/^5/, #qr/^5.0.[2-9]$/ #qr/^4/,
'apache_mpm' => qw/^(Prefork|$)/,
+ 'pg_version' => qr/^8\.[1-9]/,
+ 'apache_version' => qr/^2/,
#payment gateway survey
# 'payment_gateway' => qw/^authorizenet$/,
#stuff to add/replace later
- #'pg_version' => qr/^8\.[1-9]/,
- #'apache_version' => qr/^2/,
#'apache_mpm' => qw/^Prefork/,
+ #'pg_version' => qr/^8\.[3-9]/,
);
-sub tron_scan {
- my $cust_svc = shift;
+sub _cust_svc_external {
+ my $cust_svc_or_svcnum = shift;
- my $svc_external;
- if ( ref($cust_svc) ) {
+ my ( $cust_svc, $svc_external );
+ if ( ref($cust_svc_or_svcnum) ) {
+ $cust_svc = $cust_svc_or_svcnum;
$svc_external = $cust_svc->svc_x;
} else {
- $svc_external = qsearchs('svc_external', { 'svcnum' => $cust_svc } );
+ $svc_external = qsearchs('svc_external', { svcnum=>$cust_svc_or_svcnum } );
$cust_svc = $svc_external->cust_svc;
}
+ ( $cust_svc, $svc_external );
+
+}
+
+sub tron_ping {
+ my( $cust_svc, $svc_external ) = _cust_svc_external(shift);
+
+ my %hash = ();
+ my $machine = $svc_external->title; # or better as a cust_svc_option??
+ sshopen2($machine, *READER, *WRITER, '/bin/echo pong');
+ my $pong = scalar(<READER>);
+ close READER;
+ close WRITER;
+
+ $pong =~ /pong/;
+}
+
+sub tron_scan {
+ my( $cust_svc, $svc_external ) = _cust_svc_external(shift);
+
#don't scan again if things are okay
my $bad = 0;
foreach my $option ( keys %desired ) {
@@ -48,7 +70,9 @@
#do the scan
my %hash = ();
my $machine = $svc_external->title; # or better as a cust_svc_option??
- sshopen2($machine, *READER, *WRITER, '/usr/local/bin/freeside-yori all');
+ #sshopen2($machine, *READER, *WRITER, '/usr/local/bin/freeside-yori all');
+ #fix freeside users' patch if necessary, since packages put this in /usr/bin
+ sshopen2($machine, *READER, *WRITER, 'freeside-yori all');
while (<READER>) {
chomp;
my($option, $value) = split(/: ?/);
More information about the freeside-commits
mailing list