Code improved

This commit is contained in:
Juan 2018-11-13 00:13:42 +01:00
parent 4a1297535c
commit 9b1a11defd
2 changed files with 3 additions and 12 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
vn-vmware (1.1.0) stable; urgency=low
vn-vmware (1.1.1) stable; urgency=low
* Initial Release.

View File

@ -590,21 +590,12 @@ sub clone_machine {
);
if ($original_vm) {
if (not($overwrite)) {
if ($overwrite ne true) {
die "Machine with same name exists.";
}
$dst_tmp_name = "$dst_name.tmp";
log_message "Machine '$dst_name' already exists, cloning to '$dst_tmp_name'.";
my $tmp_vm = Vim::find_entity_view(
view_type => 'VirtualMachine',
filter => {'name' => $dst_tmp_name}
);
if ($tmp_vm) {
destroy_machine($tmp_vm);
}
}
# If MAC is not especified, it is generated by VMWare
@ -761,7 +752,7 @@ sub clone_machine {
);
$vm_clone->ReconfigVM(spec => $change_spec);
if ($original_vm && $overwrite) {
if ($original_vm) {
destroy_machine($original_vm);
log_message "Renaming '$dst_tmp_name' to '$dst_name'.";