ClusterLabs / anvil

The Anvil! Intelligent Availability™ Platform, mark 3
5 stars 6 forks source link

"error_0377" in words.xml refers to "host", operative function in `striker-initialize-host` tests `$anvil->data->{data}{type} ne "node")` #671

Open maholloway opened 1 month ago

maholloway commented 1 month ago

This issue pertains to the following package versions: anvil-core-2.92-1.2.9cfa.el9.noarch anvil-striker-2.92-1.2.9cfa.el9.noarch

Using striker-initialize-host with --type host results in the following error:

[root@mh-striker01 ~]# striker-initialize-host --target 192.168.1.175 --password $ANVIL_PASS --type host
[ Error ] - The '--type' must be 'host' or 'dr'. Was given: [host].

This appears to be due to the if statement on line 1129 of striker-initialize-host, which reads [in context]:

...
1129         if (($anvil->data->{data}{type} ne "node") && ($anvil->data->{data}{type} ne "dr"))
1130         {
1131                 $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, 'print' => 1, key => "error_0377", variables => { type => $anvil->data->{data}{type} }});
1132                 update_progress($anvil, 100, "error_0377,!!type!".$anvil->data->{data}{type}."!!");
1133                 $anvil->nice_exit({exit_code => 1});
1134         }
...

Apparent fix: Change error_0377 to refer to "node" rather than "host" or modify line 1129 of striker-initialize-host to test for --type host instead of --type node

maholloway commented 1 month ago

Works a treat with the "node" value for the --type flag. Output:

[root@mh-striker01 ~]# striker-initialize-host --target 192.168.1.175 --password $ANVIL_PASS --type node
'Initialize host' job: [] picked up.
Use of uninitialized value in concatenation (.) or string at /usr/sbin/striker-initialize-host line 1163.
Connecting to the target: [root@192.168.1.175]...
Connected!
Adding repositories.
Updating the target's operating system prior to package install.
[ Note ] - This step can take a while to finish, and there will be no input here until it completes.
Removing conflicting packages.
Will now install: [anvil-node].
Verifying installation.
Success!
Successfully added/confirmed the filter in lvm.conf.
Finished! The target should be ready for initial configuration shortly. If it isn't, please check that the 'anvil-daemon' daemon is running.
[root@mh-striker01 ~]#