Skip to content

Commit bdef968

Browse files
authored
Merge pull request #154 from MissionCriticalCloud/handle_bond_error
Do not break on optional bond script and display exception
2 parents 7ba1dfd + a060bab commit bdef968

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cloudstackops/kvm.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,14 @@ def put_scripts(self, host):
324324
if len(self.post_reboot_script) > 0:
325325
put(self.post_reboot_script,
326326
'/tmp/' + self.post_reboot_script.split('/')[-1], mode=0755, use_sudo=True)
327-
put('kvm_check_bonds.sh',
328-
'/tmp/kvm_check_bonds.sh', mode=0755, use_sudo=True)
327+
try:
328+
put('kvm_check_bonds.sh',
329+
'/tmp/kvm_check_bonds.sh', mode=0755, use_sudo=True)
330+
except Exception as e:
331+
print("Warning: kvm_check_bonds.sh failed to upload. Ignorning.")
329332
return True
330-
except:
331-
print "Error: Could not upload check scripts to host " + host.name + "."
333+
except Exception as e:
334+
print("Error: Could not upload check scripts to host " + host.name + " due to: " + str(e))
332335
return False
333336

334337
# Get bond status

0 commit comments

Comments
 (0)