Skip to content

Commit 67d7ee9

Browse files
committed
Allow to specify scripts from any folder
1 parent 60a4309 commit 67d7ee9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cloudstackops/xenserver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def host_reboot(self, host, halt_hypervisor=False):
224224

225225
# Execute script on hypervisor
226226
def exec_script_on_hypervisor(self, host, script):
227+
host = host.split('/')[-1]
227228
print "Note: Executing script '%s' on host %s.." % (script, host.name)
228229
try:
229230
with settings(show('output'), host_string=self.ssh_user + "@" + host.ipaddress):
@@ -299,10 +300,10 @@ def put_scripts(self, host):
299300
'/tmp/xenserver_parallel_evacuate.py', mode=0755)
300301
if len(self.pre_empty_script) > 0:
301302
put(self.pre_empty_script,
302-
'/tmp/' + self.pre_empty_script, mode=0755)
303+
'/tmp/' + self.pre_empty_script.split('/')[-1], mode=0755)
303304
if len(self.post_empty_script) > 0:
304305
put(self.post_empty_script,
305-
'/tmp/' + self.post_empty_script, mode=0755)
306+
'/tmp/' + self.post_empty_script.split('/')[-1], mode=0755)
306307
return True
307308
except:
308309
print "Warning: Could not upload check scripts to host " + host.name + ". Continuing anyway."

0 commit comments

Comments
 (0)