move anything using db into the db update part

This commit is contained in:
Oliver Gorwits
2017-04-14 20:38:00 +01:00
parent 2406244f4c
commit 7a2fa272b6

View File

@@ -107,6 +107,36 @@ $bool = $term->ask_yn(
);
deploy_db() if $bool;
say '';
$bool = $term->ask_yn(
prompt => 'Download and update vendor MAC prefixes (OUI data)?', default => 'n',
);
deploy_oui() if $bool;
say '';
my $default_mibhome = dir($home, 'netdisco-mibs');
if (setting('mibhome') and setting('mibhome') ne $default_mibhome) {
my $mibhome = $term->get_reply(
print_me => "MIB home options:",
prompt => "Download and update MIB files to...?",
choices => [setting('mibhome'), $default_mibhome, 'Skip this.'],
default => 'Skip this.',
);
deploy_mibs($mibhome) if $mibhome and $mibhome ne 'Skip this.';
}
else {
$bool = $term->ask_yn(
prompt => "Download and update MIB files?", default => 'n',
);
deploy_mibs($default_mibhome) if $bool;
}
sub deploy_db {
system 'netdisco-db-deploy';
print color 'bold blue';
say 'DB schema update complete.';
print color 'reset';
if (not setting('safe_password_store')) {
say '';
print color 'bold red';
@@ -155,36 +185,6 @@ schema('netdisco')->resultset('Session')->find_or_create(
{id => 'dancer_session_cookie_key', a_session => \'md5(random()::text)'},
{key => 'primary'},
);
say '';
$bool = $term->ask_yn(
prompt => 'Download and update vendor MAC prefixes (OUI data)?', default => 'n',
);
deploy_oui() if $bool;
say '';
my $default_mibhome = dir($home, 'netdisco-mibs');
if (setting('mibhome') and setting('mibhome') ne $default_mibhome) {
my $mibhome = $term->get_reply(
print_me => "MIB home options:",
prompt => "Download and update MIB files to...?",
choices => [setting('mibhome'), $default_mibhome, 'Skip this.'],
default => 'Skip this.',
);
deploy_mibs($mibhome) if $mibhome and $mibhome ne 'Skip this.';
}
else {
$bool = $term->ask_yn(
prompt => "Download and update MIB files?", default => 'n',
);
deploy_mibs($default_mibhome) if $bool;
}
sub deploy_db {
system 'netdisco-db-deploy';
print color 'bold blue';
say 'DB schema update complete.';
print color 'reset';
}
sub deploy_oui {