* Added a check to anvil-delete-server to remove the XML definition file.

* Added checks to anvil-provision-server to see if an existing server name is flagged as DELETED, instead of outright rejecting a given server name.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent e052c75e2f
commit 50d529e07c
  1. 66
      tools/test.pl

@ -26,44 +26,38 @@ $anvil->Get->switches;
$anvil->Database->connect({debug => 3}); $anvil->Database->connect({debug => 3});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0132"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0132"});
my $key_string = 'scan_drbd_message_0007,!!resource_name!srv00-sql1!!,!!resource_state!#!string!scan_drbd_unit_0004!#!!,!!resource_xml!<resource name="srv00-sql1" conf-file-line="/etc/drbd.d/srv00-sql1.res:2">] from key string: [scan_drbd_message_0007,!!resource_name!srv00-sql1!!,!!resource_state!#!string!scan_drbd_unit_0004!#!!,!!resource_xml!<resource name="srv00-sql1" conf-file-line="/etc/drbd.d/srv00-sql1.res:2"> my $key_string = 'message_0190
<host name="mk-a02n01"> job_0185
<volume vnr="0"> job_0186,!!minor!5!!,!!port!7803!!
<device minor="0">/dev/drbd_srv00-sql1_0</device> job_0188,!!job_uuid!12eeded2-c5bb-4295-8c8e-665bd9c9b83a!!,!!peer_name!mk-a02n01.digimer.ca!!
<disk>/dev/mk-a02n01_ssd0/srv00-sql1_0</disk> job_0189,!!lv_path!/dev/mk-a02n02_ssd0/srv02-lab02_0!!
<meta-disk>internal</meta-disk> job_0218
</volume> job_0190,!!resource!srv02-lab02!!
<address family="(null)" port="(null)">(null)</address> job_0191,!!resource!srv02-lab02!!
</host> job_0192
<host name="mk-a02n02"> job_0195
<volume vnr="0"> job_0203,!!resource!srv02-lab02!!
<device minor="0">/dev/drbd_srv00-sql1_0</device> job_0199,!!shell_call!/usr/bin/virt-install --connect qemu:///system \
<disk>/dev/mk-a02n02_ssd0/srv00-sql1_0</disk> --name srv02-lab02 \
<meta-disk>internal</meta-disk> --os-variant win2k19 \
</volume> --memory 8192 \
<address family="(null)" port="(null)">(null)</address> --events on_poweroff=destroy,on_reboot=restart \
</host> --vcpus 6,sockets=1,cores=6 \
<connection> --cpu host \
<host name="mk-a02n01"><address family="ipv4" port="7788">10.101.12.1</address></host> --network bridge=ifn1_bridge1,model=virtio \
<host name="mk-a02n02"><address family="ipv4" port="7788">10.101.12.2</address></host> --graphics spice \
<section name="net"> --sound ich9 \
<option name="protocol" value="C"/> --clock offset=localtime \
<option name="fencing" value="resource-and-stonith"/> --boot menu=on \
</section> --disk path=/dev/drbd/by-res/srv02-lab02/0,target.bus=virtio,driver.io=threads,cache=writeback,driver.discard=unmap,boot.order=1 \
<section name="disk"> --disk path=/mnt/shared/files/Windows_Server_2019_eval.iso,device=cdrom,shareable=on,boot.order=2 \
<option name="c-max-rate" value="500M"/> --disk path=/mnt/shared/files/virtio-win-0.1.185.iso,device=cdrom,shareable=on,boot.order=3 --force \
</section> --noautoconsole --wait -1 > /var/log/anvil-server_srv02-lab02.log
</connection> !!
</resource>!!'; job_0200';
my $out_string = $anvil->Words->parse_banged_string({ my ($free_minor, $free_port) = $anvil->Words->parse_banged_string({
debug => 2, debug => 2,
key_string => $key_string, key_string => $key_string,
}); });
print "Got:
====
".$out_string."
====
";
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});

Loading…
Cancel
Save