Exemple #1
0
 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)
Exemple #2
0
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)