Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cloudstackops/xenserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_poolmaster(self, host):
def get_patch_level(self, host):
try:
with settings(host_string=self.ssh_user + "@" + host.ipaddress):
return fab.run("for p in $(xe patch-list | grep XS | awk {'print $4'} | tr -d \" \" |\
return fab.run("for p in $(xe patch-list | grep XS.*E | awk {'print $4'} | tr -d \" \" |\
sort | tr '\n' ' '); do echo -n $p \"(\"; xe patch-list name-label=$p params=hosts |\
awk -F: {'print $2'} | tr -cd , | awk {'print $1 \",\"'} | tr -d '\n' | wc -c | tr -d '\n'; echo -n \") \"; done")
except:
Expand Down Expand Up @@ -220,7 +220,10 @@ def pool_ha_enable(self, host):
print "Note: Enabling HA"
try:
with settings(host_string=self.ssh_user + "@" + host.ipaddress):
return fab.run("xe pool-ha-enable heartbeat-sr-uuids=$(xe sr-list type=nfs params=uuid --minimal) ha-config:timeout=180 ha-config:ha-host-failures-to-tolerate=1")
if fab.run("cat /etc/redhat-release | awk '{ $3 = substr($3,1,3); print $3 }'") == "6.2":
return fab.run("xe pool-ha-enable heartbeat-sr-uuids=$(xe sr-list type=nfs params=uuid --minimal) ha-config:timeout=180 ha-config:ha-host-failures-to-tolerate=1")
else:
return fab.run("xe pool-ha-enable heartbeat-sr-uuids=$(xe sr-list type=nfs params=uuid --minimal) ha-config:timeout=180; xe pool-param-set uuid=$(xe pool-list params=uuid --minimal) ha-host-failures-to-tolerate=1")
except:
return False

Expand Down