Exemplo n.º 1
0
Arquivo: api.py Projeto: 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)
Exemplo n.º 2
0
Arquivo: cli.py Projeto: 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)