You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/11/14 19:47:05 UTC
[1/2] incubator-trafficcontrol git commit: Fixed the TO
UI.Tools.DBDump facility
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/psql-rebase e30afe9f5 -> ca55e93f7
Fixed the TO UI.Tools.DBDump facility
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/4c309363
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/4c309363
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/4c309363
Branch: refs/heads/psql-rebase
Commit: 4c30936390aacdf1d0a92fd12841d0ad1a1db114
Parents: e30afe9
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Nov 11 10:09:42 2016 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Mon Nov 14 12:40:09 2016 -0700
----------------------------------------------------------------------
traffic_ops/app/lib/UI/ConfigFiles.pm | 5 -----
traffic_ops/app/lib/UI/GenDbDump.pm | 13 +++++++------
2 files changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4c309363/traffic_ops/app/lib/UI/ConfigFiles.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/ConfigFiles.pm b/traffic_ops/app/lib/UI/ConfigFiles.pm
index 6845439..a1f147d 100644
--- a/traffic_ops/app/lib/UI/ConfigFiles.pm
+++ b/traffic_ops/app/lib/UI/ConfigFiles.pm
@@ -150,10 +150,6 @@ sub server_data {
my $server;
- # if ( defined( $self->app->session->{server_data} ) ) {
- # $server = $self->app->session->{server_data};
- # return $server;
- # }
if ( $id =~ /^\d+$/ ) {
$server = $self->db->resultset('Server')->search( { id => $id } )->single;
}
@@ -161,7 +157,6 @@ sub server_data {
$server = $self->db->resultset('Server')->search( { host_name => $id } )->single;
}
- # $self->app->session->{server_data} = $server;
return $server;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/4c309363/traffic_ops/app/lib/UI/GenDbDump.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/UI/GenDbDump.pm b/traffic_ops/app/lib/UI/GenDbDump.pm
index 44f9f11..1fa8088 100644
--- a/traffic_ops/app/lib/UI/GenDbDump.pm
+++ b/traffic_ops/app/lib/UI/GenDbDump.pm
@@ -16,6 +16,7 @@ package UI::GenDbDump;
#
#
use Mojo::Base 'Mojolicious::Controller';
+use Data::Dumper;
sub dbdump {
my $self = shift;
@@ -23,18 +24,18 @@ sub dbdump {
my $db_user = $Schema::user;
my $db_pass = $Schema::pass;
- my $db_name = ( split( /:/, $Schema::dsn ) )[2];
- my $db_host = $Schema::hostname;
- $db_name =~ s/database=//;
+ my $db_name = $Schema::dsn;
+ my $host;
+ my $port;
+ my $dsn = $Schema::dsn;
+ ($db_name, $host, $port) = $dsn =~ /:database=(\w+);host=(\w+);port=(\d+)/;
- my $cmd = "pg_dump --username=" . $db_user . " " . $db_name . " > " . $filename;
+ my $cmd = "pg_dump -U " . $db_user . " -h localhost -C --column-insert";
my $extension = ".psql";
my $data = `$cmd`;
-
$self->res->headers->content_type("application/download");
-
$self->res->headers->content_disposition( "attachment; filename=\"" . $filename . "\"" );
$self->render( data => $data );
}
[2/2] incubator-trafficcontrol git commit: This closes #79
Posted by mi...@apache.org.
This closes #79
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ca55e93f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ca55e93f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ca55e93f
Branch: refs/heads/psql-rebase
Commit: ca55e93f7d2916c07593ded17463df76c8e7a4b0
Parents: 4c30936
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Nov 14 12:46:52 2016 -0700
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Mon Nov 14 12:46:52 2016 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------