projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
307a7d8
)
DSL status pulling, RT#13656
author
ivan
<ivan>
Thu, 10 Nov 2011 21:55:49 +0000
(21:55 +0000)
committer
ivan
<ivan>
Thu, 10 Nov 2011 21:55:49 +0000
(21:55 +0000)
FS/FS/part_export/http_status.pm
patch
|
blob
|
history
FS/FS/svc_Common.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/http_status.pm
b/FS/FS/part_export/http_status.pm
index
08be3a0
..
2d15231
100644
(file)
--- a/
FS/FS/part_export/http_status.pm
+++ b/
FS/FS/part_export/http_status.pm
@@
-1,8
+1,9
@@
-package
s
FS::part_export::http_status;
+package FS::part_export::http_status;
use base qw( FS::part_export );
use strict;
use warnings;
use base qw( FS::part_export );
use strict;
use warnings;
+use vars qw( %info );
use LWP::UserAgent;
use HTTP::Request::Common;
use LWP::UserAgent;
use HTTP::Request::Common;
@@
-29,7
+30,7
@@
sub export_getstatus {
my $url = $self->option('url');
{
no strict 'refs';
my $url = $self->option('url');
{
no strict 'refs';
- ${$_} = $svc_x->getfield($
x
) foreach $svc_x->fields;
+ ${$_} = $svc_x->getfield($
_
) foreach $svc_x->fields;
$url = eval(qq($url));
}
$url = eval(qq($url));
}
@@
-41,7
+42,6
@@
sub export_getstatus {
$$htmlref = $response->is_error ? $response->error_as_HTML
: $response->content;
$$htmlref = $response->is_error ? $response->error_as_HTML
: $response->content;
-
#hash data note yet implemented for this status export
}
#hash data note yet implemented for this status export
}
diff --git
a/FS/FS/svc_Common.pm
b/FS/FS/svc_Common.pm
index
e83d96e
..
28f759a
100644
(file)
--- a/
FS/FS/svc_Common.pm
+++ b/
FS/FS/svc_Common.pm
@@
-995,6
+995,26
@@
sub export_getsettings {
( \%settings, \%defaults );
}
( \%settings, \%defaults );
}
+=item export_getstatus
+
+Runs export_getstatus callbacks and returns a two item list consisting of an
+HTML status and a status hashref.
+
+=cut
+
+sub export_getstatus {
+ my $self = shift;
+ my $html = '';
+ my %hash = ();
+ my $error = $self->export('getstatus', \$html, \%hash);
+ if ( $error ) {
+ #XXX bubble this up better
+ warn "error running export_getstatus: $error";
+ return ( '', {} );
+ }
+ ( $html, \%hash );
+}
+
=item export HOOK [ EXPORT_ARGS ]
Runs the provided export hook (i.e. "suspend", "unsuspend") for this service.
=item export HOOK [ EXPORT_ARGS ]
Runs the provided export hook (i.e. "suspend", "unsuspend") for this service.