Example #1
0
File: api.py Project: vinzenz/vdsm
 def hostRemoveByUuid(self, hostUuid, force=False, options=None):
     for hostInfo in self.svdsmProxy.glusterPeerStatus():
         if hostInfo['uuid'] == hostUuid:
             hostName = hostInfo['hostname']
             break
     else:
         raise ge.GlusterHostNotFoundException()
     self.svdsmProxy.glusterPeerDetach(hostName, force)
Example #2
0
File: cli.py Project: eprasad/vdsm
def peerDetach(hostName, force=False):
    command = _getGlusterPeerCmd() + ["detach", hostName]
    if force:
        command.append('force')
    try:
        _execGlusterXml(command)
        return True
    except ge.GlusterCmdFailedException as e:
        if e.rc == 2:
            raise ge.GlusterHostNotFoundException(rc=e.rc, err=e.err)
        else:
            raise ge.GlusterHostRemoveFailedException(rc=e.rc, err=e.err)