Commit 8449cd17 authored by Antoine Millet's avatar Antoine Millet

Implemented rescue tag on VM

parent b9ff8338
......@@ -20,7 +20,10 @@ from xml.etree import cElementTree as et
from StringIO import StringIO
import libvirt
from cloudcontrol.common.client.tags import ttl, refresh
from cloudcontrol.node.utils import execute
from cloudcontrol.common.client.tags import ttl, refresh, background
logger = logging.getLogger(__name__)
......@@ -55,6 +58,17 @@ def uuid(dom):
return dom.uuid.lower()
def rescue(dom):
"""Is rescue mode enabled or not"""
rescue_path = dom.hypervisor.handler.main.config.rescue_script
rcode, output = execute(dom.hypervisor.handler.main, [rescue_path, '-s',])
if rcode == 0:
return output.strip()
return 'error'
def status(dom):
return dom.state
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment