Commit 992a8c45 authored by Steve Trevanion's avatar Steve Trevanion
Browse files

tweaks for live Mysql warning, parsing of loutre params

parent ca4749f8
...@@ -238,8 +238,10 @@ sub get_common_params { ...@@ -238,8 +238,10 @@ sub get_common_params {
=head2 get_loutre_params =head2 get_loutre_params
Example : my @allowed_params = $self->get_loutre_params, 'extra_param'; Arg : (optional) return a list to parse or not
Description : Returns a list of commonly used parameters in for working with a loutre db Example : $support->parse_extra_options($support->get_loutre_params('parse'))
Description : Returns a list of commonly used loutre db parameters - parse option is
simply used to distinguish between reporting and parsing parameters
Return type : Array - list of common parameters Return type : Array - list of common parameters
Exceptions : none Exceptions : none
Caller : general Caller : general
...@@ -247,13 +249,25 @@ sub get_common_params { ...@@ -247,13 +249,25 @@ sub get_common_params {
=cut =cut
sub get_loutre_params { sub get_loutre_params {
return qw( my ($self,$p) = @_;
loutrehost if ($p) {
loutreport return qw(
loutreuser loutrehost=s
loutrepass loutreport=s
loutredbname loutreuser=s
); loutrepass=s
loutredbname=s
);
}
else {
return qw(
loutrehost
loutreport
loutreuser
loutrepass
loutredbname
);
}
} }
=head2 remove_vega_params =head2 remove_vega_params
...@@ -293,9 +307,9 @@ sub confirm_params { ...@@ -293,9 +307,9 @@ sub confirm_params {
print "Running script with these parameters:\n\n"; print "Running script with these parameters:\n\n";
print $self->list_all_params; print $self->list_all_params;
if ($self->param('host') eq 'web-4-11') { if ($self->param('host') eq 'ensdb-1-10') {
# ask user if he wants to proceed # ask user if he wants to proceed
exit unless $self->user_proceed("**************\n\n You're working on web-4-11! Is that correct and you want to continue ?\n\n**************"); exit unless $self->user_proceed("**************\n\n You're working on ensdb-1-10! Is that correct and you want to continue ?\n\n**************");
} }
else { else {
# ask user if he wants to proceed # ask user if he wants to proceed
...@@ -362,7 +376,6 @@ sub create_commandline_options { ...@@ -362,7 +376,6 @@ sub create_commandline_options {
if ($settings->{'allowed_params'}) { if ($settings->{'allowed_params'}) {
# exclude params explicitly stated # exclude params explicitly stated
my %exclude = map { $_ => 1 } @{ $settings->{'exclude'} || [] }; my %exclude = map { $_ => 1 } @{ $settings->{'exclude'} || [] };
foreach my $param ($self->allowed_params) { foreach my $param ($self->allowed_params) {
unless ($exclude{$param}) { unless ($exclude{$param}) {
my ($first, @rest) = $self->param($param); my ($first, @rest) = $self->param($param);
...@@ -387,7 +400,6 @@ sub create_commandline_options { ...@@ -387,7 +400,6 @@ sub create_commandline_options {
foreach my $param (keys %param_hash) { foreach my $param (keys %param_hash) {
$options_string .= sprintf("--%s %s ", $param, $param_hash{$param}); $options_string .= sprintf("--%s %s ", $param, $param_hash{$param});
} }
return $options_string; return $options_string;
} }
...@@ -689,8 +701,17 @@ sub get_database { ...@@ -689,8 +701,17 @@ sub get_database {
-dbname => $self->param("${prefix}dbname"), -dbname => $self->param("${prefix}dbname"),
-group => $database, -group => $database,
); );
#can use this approach to get dna from another db
# explicitely set the dnadb to itself - by default the Registry assumes # my $dna_db = $adaptors{$database}->new(
# -host => 'otterlive',
# -port => '3301',
# -user => $self->param("${prefix}user"),
# -pass => $self->param("${prefix}pass"),
# -dbname => 'loutre_human',
# );
# $dba->dnadb($dna_db);
# otherwise explicitely set the dnadb to itself - by default the Registry assumes
# a group 'core' for this now # a group 'core' for this now
$dba->dnadb($dba); $dba->dnadb($dba);
......
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