* Fixed a bug with striker's initial configuration where 'update_value_only' was being set for the initial store of the config variables.

* Added fonts to Striker's RPM list and to the anvil-striker RPM dependency list so that the terminal is actually useful.

Signed-off-by: Madison Kelly <digimer@neutron.digimer.ca>
main
Madison Kelly 5 years ago
parent 00b9bce669
commit 83d6cff4af
  1. 17
      Anvil/Tools/Database.pm
  2. 55
      cgi-bin/striker
  3. 5
      rpm/SPECS/anvil.spec
  4. 1
      share/words.xml
  5. 6
      tools/striker-manage-install-target

@ -7700,7 +7700,7 @@ This is an optional database table name that the variables relates to. Generally
=head3 update_value_only (optional, default '0') =head3 update_value_only (optional, default '0')
When set to C<< 1 >>, this method will only update the variable's C<< variable_value >> column. Any other parameters are used to help locate the variable to update only. When set to C<< 1 >>, this method will only update the variable's C<< variable_value >> column. Any other parameters are used to help locate the variable to update only. If the C<< variable_uuid >> isn't passed and can't be found, the call will fail and an empty string is returned.
=cut =cut
sub insert_or_update_variables sub insert_or_update_variables
@ -7807,6 +7807,21 @@ AND
if ($update_value_only) if ($update_value_only)
{ {
# Nothing to do. # Nothing to do.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, priority => "alert", key => "warning_0030"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => {
uuid => $uuid,
file => $file,
line => $line,
variable_uuid => $variable_uuid,
variable_name => $variable_name,
variable_value => $variable_value,
variable_default => $variable_default,
variable_description => $variable_description,
variable_section => $variable_section,
variable_source_uuid => $variable_source_uuid,
variable_source_table => $variable_source_table,
update_value_only => $update_value_only,
}});
return(""); return("");
} }

@ -1971,7 +1971,6 @@ sub process_prep_network
{ {
# Clear the network map variable. # Clear the network map variable.
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 2,
variable_name => "config::map_network", variable_name => "config::map_network",
variable_value => 0, variable_value => 0,
variable_default => 0, variable_default => 0,
@ -1999,7 +1998,6 @@ sub process_prep_network
else else
{ {
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step2::host_name::value", variable_name => "form::config_step2::host_name::value",
variable_value => $anvil->data->{cgi}{host_name}{value}, variable_value => $anvil->data->{cgi}{host_name}{value},
variable_default => "", variable_default => "",
@ -2007,7 +2005,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
} }
@ -2034,7 +2031,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
} }
@ -2064,7 +2060,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
} }
@ -2083,7 +2078,6 @@ sub process_prep_network
variable_section => "config_step1", variable_section => "config_step1",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
foreach my $i (1..$loops) foreach my $i (1..$loops)
@ -2180,7 +2174,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3, debug => 3,
@ -2191,7 +2184,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -2235,7 +2227,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
} }
@ -2253,7 +2244,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -2325,7 +2315,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
if ($anvil->data->{cgi}{$link2_key}{value}) if ($anvil->data->{cgi}{$link2_key}{value})
@ -2339,7 +2328,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -2353,7 +2341,6 @@ sub process_prep_network
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value}, variable_source_uuid => $anvil->data->{cgi}{host_uuid}{value},
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
$interfaces .= $anvil->Template->get({file => "anvil.html", name => "interface-entry", variables => { $interfaces .= $anvil->Template->get({file => "anvil.html", name => "interface-entry", variables => {
@ -2436,7 +2423,7 @@ sub process_prep_network
{ {
# We're mapping # We're mapping
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 2, debug => 3,
variable_name => "config::map_network", variable_name => "config::map_network",
variable_value => 1, variable_value => 1,
variable_default => 0, variable_default => 0,
@ -2657,7 +2644,7 @@ sub process_prep_host_page
if ($host_uuid) if ($host_uuid)
{ {
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 2, debug => 3,
variable_name => "system::configured", variable_name => "system::configured",
variable_source_uuid => $host_uuid, variable_source_uuid => $host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
@ -3919,11 +3906,11 @@ AND
variable_source_uuid = ".$anvil->Database->quote($anvil->Get->host_uuid)." variable_source_uuid = ".$anvil->Database->quote($anvil->Get->host_uuid)."
ORDER BY ORDER BY
variable_name ASC;"; variable_name ASC;";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0124", variables => { query => $query }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0124", variables => { query => $query }});
my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__}); my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results}; my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
results => $results, results => $results,
count => $count, count => $count,
}}); }});
@ -3940,7 +3927,7 @@ ORDER BY
{ {
my $variable = $1; my $variable = $1;
$anvil->data->{cgi}{$variable}{value} = $variable_value; $anvil->data->{cgi}{$variable}{value} = $variable_value;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "cgi::${variable}::value" => $anvil->data->{cgi}{$variable}{value} }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "cgi::${variable}::value" => $anvil->data->{cgi}{$variable}{value} }});
} }
} }
} }
@ -4299,7 +4286,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4322,7 +4308,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4345,7 +4330,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4379,7 +4363,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4439,7 +4422,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4469,7 +4451,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4500,7 +4481,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
else else
@ -4548,7 +4528,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
else else
@ -4631,7 +4610,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
# Record the gateway interface # Record the gateway interface
@ -4643,7 +4621,6 @@ sub sanity_check_step2
variable_section => "config_step2", variable_section => "config_step2",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
} }
@ -4656,13 +4633,19 @@ sub sanity_check_step2
sub sanity_check_step1 sub sanity_check_step1
{ {
my ($anvil) = @_; my ($anvil) = @_;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0131", variables => { function => "sanity_check_step1()" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0131", variables => { function => "sanity_check_step1()" }});
# This will flip if we run into a problem. # This will flip if we run into a problem.
my $sane = 1; my $sane = 1;
$anvil->data->{cgi}{organization}{value} = "" if not defined $anvil->data->{cgi}{organization}{value};
# Organization just needs *something* # Organization just needs *something*
if ((not defined $anvil->data->{cgi}{organization}{value}) or (not $anvil->data->{cgi}{organization}{value})) $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"cgi::organization::alert" => $anvil->data->{cgi}{organization}{alert},
}});
if (not $anvil->data->{cgi}{organization}{value})
{ {
$anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "error_0020", variables => { field => "striker_0003" }}) }}); $anvil->data->{form}{error_massage} = $anvil->Template->get({file => "main.html", name => "error_message", variables => { error_message => $anvil->Words->string({key => "error_0020", variables => { field => "striker_0003" }}) }});
$anvil->data->{cgi}{organization}{alert} = 1; $anvil->data->{cgi}{organization}{alert} = 1;
@ -4673,6 +4656,7 @@ sub sanity_check_step1
{ {
# Record the answer. # Record the answer.
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step1::organization::value", variable_name => "form::config_step1::organization::value",
variable_value => $anvil->data->{cgi}{organization}{value}, variable_value => $anvil->data->{cgi}{organization}{value},
variable_default => "", variable_default => "",
@ -4680,7 +4664,6 @@ sub sanity_check_step1
variable_section => "config_step1", variable_section => "config_step1",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4696,6 +4679,7 @@ sub sanity_check_step1
{ {
# Record the answer. # Record the answer.
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step1::prefix::value", variable_name => "form::config_step1::prefix::value",
variable_value => $anvil->data->{cgi}{prefix}{value}, variable_value => $anvil->data->{cgi}{prefix}{value},
variable_default => "", variable_default => "",
@ -4703,7 +4687,6 @@ sub sanity_check_step1
variable_section => "config_step1", variable_section => "config_step1",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4719,6 +4702,7 @@ sub sanity_check_step1
{ {
# Record the answer. # Record the answer.
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step1::domain::value", variable_name => "form::config_step1::domain::value",
variable_value => $anvil->data->{cgi}{domain}{value}, variable_value => $anvil->data->{cgi}{domain}{value},
variable_default => "", variable_default => "",
@ -4726,7 +4710,6 @@ sub sanity_check_step1
variable_section => "config_step1", variable_section => "config_step1",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4742,6 +4725,7 @@ sub sanity_check_step1
{ {
# Record the answer. # Record the answer.
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step1::sequence::value", variable_name => "form::config_step1::sequence::value",
variable_value => $anvil->data->{cgi}{sequence}{value}, variable_value => $anvil->data->{cgi}{sequence}{value},
variable_default => "", variable_default => "",
@ -4749,7 +4733,6 @@ sub sanity_check_step1
variable_section => "config_step1", variable_section => "config_step1",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
@ -4787,6 +4770,7 @@ sub sanity_check_step1
{ {
# Sane, Record the answers. # Sane, Record the answers.
$anvil->Database->insert_or_update_variables({ $anvil->Database->insert_or_update_variables({
debug => 3,
variable_name => "form::config_step1::ifn_count::value", variable_name => "form::config_step1::ifn_count::value",
variable_value => $anvil->data->{cgi}{ifn_count}{value}, variable_value => $anvil->data->{cgi}{ifn_count}{value},
variable_default => "", variable_default => "",
@ -4794,11 +4778,10 @@ sub sanity_check_step1
variable_section => "config_step1", variable_section => "config_step1",
variable_source_uuid => $anvil->Get->host_uuid, variable_source_uuid => $anvil->Get->host_uuid,
variable_source_table => "hosts", variable_source_table => "hosts",
update_value_only => 1,
}); });
} }
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { sane => $sane }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { sane => $sane }});
return($sane); return($sane);
} }

@ -82,7 +82,12 @@ Common base libraries required for the Anvil! system.
Summary: Alteeve's Anvil! Striker dashboard package Summary: Alteeve's Anvil! Striker dashboard package
Requires: anvil-core Requires: anvil-core
Requires: anvil-striker-extra Requires: anvil-striker-extra
Requires: bpg-dejavu-sans-fonts
Requires: createrepo Requires: createrepo
Requires: dejavu-fonts-common
Requires: dejavu-sans-fonts
Requires: dejavu-sans-mono-fonts
Requires: dejavu-serif-fonts
Requires: dhcp-server Requires: dhcp-server
Requires: firefox Requires: firefox
Requires: gcc Requires: gcc

@ -1267,6 +1267,7 @@ Failure! The return code: [#!variable!return_code!#] was received ('0' was expec
<key name="warning_0027">There was a problem saving the alert recipient data. Please check the logs for more information.</key> <key name="warning_0027">There was a problem saving the alert recipient data. Please check the logs for more information.</key>
<key name="warning_0028">Failed to read the fence agent: [#!variable!agent!#] metadata. Ignoring it.</key> <key name="warning_0028">Failed to read the fence agent: [#!variable!agent!#] metadata. Ignoring it.</key>
<key name="warning_0029">While resync'ing the table: [#!variable!table!#] on: [#!variable!host_name!# (#!variable!host_uuid!#)], there was an entry found in the public schema (#!variable!column!# = #!variable!uuid!#) but not in the history schema. This shouldn't happen, and it probably a bug. Switching the query's schema from public to history for the query: [#!variable!query!#] is being dropped.</key> <key name="warning_0029">While resync'ing the table: [#!variable!table!#] on: [#!variable!host_name!# (#!variable!host_uuid!#)], there was an entry found in the public schema (#!variable!column!# = #!variable!uuid!#) but not in the history schema. This shouldn't happen, and it probably a bug. Switching the query's schema from public to history for the query: [#!variable!query!#] is being dropped.</key>
<key name="warning_0030">Databse->insert_or_update_variables() was called with 'update_value_only' set, but the 'variable_uuid' wasn't passed or the 'variable_uuid' wasn't found given the 'variable_name'. Unable to update. Passed in values are logged below this message</key>
<!-- Errors --> <!-- Errors -->
<key name="error_0001">There are not enough network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key> <key name="error_0001">There are not enough network interfaces on this machine. You have: [#!variable!interface_count!#] interface(s), and you need at least: [#!variable!required_interfaces_for_single!#] interfaces to connect to the requested networks (one for Back-Channel and one for each Internet-Facing network).</key>

@ -1234,11 +1234,11 @@ sub load_packages
"boost-regex.x86_64", "boost-regex.x86_64",
"boost-system.x86_64", "boost-system.x86_64",
"boost-thread.x86_64", "boost-thread.x86_64",
"bpg-dejavu-sans-fonts.noarch",
"brotli.x86_64", "brotli.x86_64",
"bubblewrap.x86_64", "bubblewrap.x86_64",
"bzip2-libs.x86_64", "bzip2-libs.x86_64",
"bzip2.x86_64", "bzip2.x86_64",
],
c => [ c => [
"c-ares.x86_64", "c-ares.x86_64",
"ca-certificates.noarch", "ca-certificates.noarch",
@ -1296,6 +1296,10 @@ sub load_packages
"dbus-x11.x86_64", "dbus-x11.x86_64",
"dbus.x86_64", "dbus.x86_64",
"dconf.x86_64", "dconf.x86_64",
"dejavu-fonts-common.noarch",
"dejavu-sans-fonts.noarch",
"dejavu-sans-mono-fonts.noarch",
"dejavu-serif-fonts.noarch",
"desktop-file-utils.x86_64", "desktop-file-utils.x86_64",
"device-mapper-event-libs.x86_64", "device-mapper-event-libs.x86_64",
"device-mapper-event.x86_64", "device-mapper-event.x86_64",

Loading…
Cancel
Save