Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
guiHive
Commits
a1c0cf78
Commit
a1c0cf78
authored
Jan 27, 2017
by
Matthieu Muffato
Browse files
Got rid of get_hive_db_meta_key() because it is redundant with HivePipeline attributes
parent
9a42273b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
17 deletions
+12
-17
scripts/db_connect.pl
scripts/db_connect.pl
+9
-6
scripts/db_test.pl
scripts/db_test.pl
+1
-1
scripts/lib/version_check.pm
scripts/lib/version_check.pm
+2
-10
No files found.
scripts/db_connect.pl
View file @
a1c0cf78
...
...
@@ -53,7 +53,7 @@ my $dbConn = $pipeline->hive_dba;
eval
{
my
$graph
=
formAnalyses
(
$pipeline
);
if
(
$graph
)
{
my
$html
=
formResponse
(
$pipeline
->
hive_dba
);
my
$html
=
formResponse
(
$pipeline
);
$response
->
out_msg
({"
graph
"
=>
$graph
,
"
html
"
=>
$html
});
}
else
{
$response
->
err_msg
('
GraphViz failed to generate a diagram
');
...
...
@@ -68,7 +68,10 @@ if ($@) {
print
$response
->
toJSON
();
sub
formResponse
{
my
(
$dba
)
=
@_
;
my
(
$hive_pipeline
)
=
@_
;
my
$dba
=
$hive_pipeline
->
hive_dba
;
my
$info
;
$info
->
{
db_name
}
=
$dba
->
dbc
->
dbname
;
...
...
@@ -76,11 +79,11 @@ sub formResponse {
$info
->
{
port
}
=
$dba
->
dbc
->
port
;
$info
->
{
driver
}
=
$dba
->
dbc
->
driver
;
$info
->
{
username
}
=
$dba
->
dbc
->
username
;
$info
->
{
hive_db_version
}
=
get_
hive_
db_meta_key
(
$dba
,
'
hive_sql_schema_version
'
);
$info
->
{
hive_db_version
}
=
$
hive_
pipeline
->
hive_sql_schema_version
(
);
$info
->
{
hive_code_version
}
=
get_hive_code_version
();
$info
->
{
pipeline_name
}
=
get_
hive_
db_meta_key
(
$dba
,
'
hive_pipeline_name
'
);
$info
->
{
hive_auto_rebalance_semaphores
}
=
get_
hive_
db_meta_key
(
$dba
,
'
hive_auto_rebalance_semaphores
'
)
?
'
Enabled
'
:
'
Disabled
';
$info
->
{
hive_use_param_stack
}
=
get_
hive_
db_meta_key
(
$dba
,
'
hive_use_param_stack
'
)
?
'
Enabled
'
:
'
Disabled
';
$info
->
{
pipeline_name
}
=
$
hive_
pipeline
->
hive_pipeline_name
(
);
$info
->
{
hive_auto_rebalance_semaphores
}
=
$
hive_
pipeline
->
hive_auto_rebalance_semaphores
(
)
?
'
Enabled
'
:
'
Disabled
';
$info
->
{
hive_use_param_stack
}
=
$
hive_
pipeline
->
hive_use_param_stack
(
)
?
'
Enabled
'
:
'
Disabled
';
my
$template
=
HTML::
Template
->
new
(
filename
=>
$connection_template
);
$template
->
param
(
%$info
);
...
...
scripts/db_test.pl
View file @
a1c0cf78
...
...
@@ -66,7 +66,7 @@ sub formResponse {
$info
->
{
port
}
=
$dba
->
dbc
->
port
;
$info
->
{
driver
}
=
$dba
->
dbc
->
driver
;
$info
->
{
username
}
=
$dba
->
dbc
->
username
;
$info
->
{
hive_db_version
}
=
get_hive_db_meta_key
('
hive_sql_schema_version
'
);
$info
->
{
hive_db_version
}
=
$pipeline
->
hive_sql_schema_version
(
);
$info
->
{
hive_code_version
}
=
get_hive_code_version
();
# $info->{mysql_url} = "?username=" . $dba->dbc->username . "&host=" . $dba->dbc->host . "&dbname=" . $dba->dbc->dbname . "&port=" . $dba->dbc->port;
...
...
scripts/lib/version_check.pm
View file @
a1c0cf78
...
...
@@ -32,20 +32,12 @@ use msg;
use
vars
qw(@ISA @EXPORT)
;
@ISA
=
qw(Exporter)
;
@EXPORT
=
qw(get_hive_code_version
get_hive_db_meta_key
check_db_versions_match)
;
@EXPORT
=
qw(get_hive_code_version check_db_versions_match)
;
sub
get_hive_code_version
{
return
Bio::EnsEMBL::Hive::DBSQL::
SqlSchemaAdaptor
->
get_code_sql_schema_version
();
}
sub
get_hive_db_meta_key
{
my
(
$dbConn
,
$key_name
)
=
@_
;
my
$metaAdaptor
=
$dbConn
->
get_MetaAdaptor
;
my
$val
;
$val
=
eval
{
$metaAdaptor
->
fetch_by_meta_key
(
$key_name
)
->
{'
meta_value
'};
};
return
$val
;
}
sub
_fail_with_status_message
{
my
(
$status
,
$message
)
=
@_
;
my
$response
=
msg
->
new
();
...
...
@@ -79,7 +71,7 @@ sub check_db_versions_match {
my
$code_version
=
$version
||
get_hive_code_version
();
my
$hive_db_version
;
eval
{
$hive_db_version
=
get_hive_db_meta_key
(
$pipeline
->
hive_
dba
,
'
hive_
sql_schema_version
'
);
$hive_db_version
=
$pipeline
->
hive_sql_schema_version
(
);
};
if
(
$@
)
{
exit
(
0
)
if
$silent
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment