Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-11 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 3: Code-Review-1

(2 comments)


File vdsm/gluster/api.py
Line 212: def hostAdd(self, hostName, options=None):
Line 213: self.svdsmProxy.glusterPeerProbe(hostName)
Line 214: 
Line 215: @exportAsVerb
Line 216: def hostRemove(self, hostName, force=False, hostUuid=None, 
options=None):
Sorry for asking only now, but why do we need this complexity? Wouldn't a new 
verb named hostRemoveByUuid be better?
Line 217: if hostUuid:
Line 218: flag = True
Line 219: for hostInfo in self.svdsmProxy.glusterPeerStatus():
Line 220: if hostInfo['uuid'] == hostUuid:


Line 220: if hostInfo['uuid'] == hostUuid:
Line 221: hostName = hostInfo['hostname']
Line 222: flag = False
Line 223: break
Line 224: if flag:
"For" has an "else" construct, exactly to avoid this flag.
Line 225: log.warn("Host with UUID:%s not found " % hostUuid)
Line 226: self.svdsmProxy.glusterPeerDetach(hostName, force)
Line 227: 
Line 228: @exportAsVerb


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-11 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 3:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4547/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5347/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5426/ : SUCCESS

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-11 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 3: Verified-1

Build Failed 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4521/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5321/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5399/ : FAILURE

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-11 Thread dnarayan
Darshan N has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 3:

I have restructured the patch as per the suggestions.

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-09 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 2: Code-Review-1

(7 comments)


File vdsm/gluster/api.py
Line 212: self.svdsmProxy.glusterPeerProbe(hostName)
Line 213: 
Line 214: @exportAsVerb
Line 215: def hostRemove(self, hostName, force=False, options={}):
Line 216: host = None
the code would become simpler if you keep using the hostName variable, and 
override it with the name acquired by hostUuid.
Line 217: hostUuid = options.get('hostUuid')
Line 218: 
Line 219: # get hostname of given host uuid
Line 220: if hostUuid:


Line 218: 
Line 219: # get hostname of given host uuid
Line 220: if hostUuid:
Line 221: for hostInfo in self.svdsmProxy.glusterPeerStatus():
Line 222: if(hostInfo['uuid'] == hostUuid):
it's not C here ;-), drop the parenthesis.
Line 223: host = hostInfo['hostname']
Line 224: break
Line 225: if not host:
Line 226: log.warn("Host with UUID:%s not found " % hostUuid)


Line 221: for hostInfo in self.svdsmProxy.glusterPeerStatus():
Line 222: if(hostInfo['uuid'] == hostUuid):
Line 223: host = hostInfo['hostname']
Line 224: break
Line 225: if not host:
it would be nicer to drop the assignment of line 216, and do an "else" clause 
for the "for" loop, logging the warning.
Line 226: log.warn("Host with UUID:%s not found " % hostUuid)
Line 227: host = hostName
Line 228: else:
Line 229: host = hostName



File vdsm/gluster/vdsmapi-gluster-schema.json
Line 919:  'data': {'hostName': 'str'},
Line 920:  'returns': 'bool'}
Line 921: 
Line 922: ##
Line 923: # @HostOptions:
RemoveHostOptions, maybe.
Line 924: #
Line 925: # List of host options.
Line 926: #
Line 927: # @hostUuid:  The Uuid of the host


Line 923: # @HostOptions:
Line 924: #
Line 925: # List of host options.
Line 926: #
Line 927: # @hostUuid:  The Uuid of the host
state that it has precedence over hostName.
Line 928: #
Line 929: # Since: 4.10.3
Line 930: ##
Line 931: {'type': 'HostOptions',


Line 925: # List of host options.
Line 926: #
Line 927: # @hostUuid:  The Uuid of the host
Line 928: #
Line 929: # Since: 4.10.3
it's 4.14 by now.
Line 930: ##
Line 931: {'type': 'HostOptions',
Line 932:  'data': {'hostUuid': 'UUID'}}
Line 933: 


Line 942: #
Line 943: # Since: 4.10.3
Line 944: ##
Line 945: {'command': {'class': 'GlusterHost', 'name': 'remove'},
Line 946:  'data': {'hostName': 'str', 'force': 'bool', 'options': 
'HostOptions'}
"options" are optional. state this with an *.
Line 947:  'returns': 'bool'}
Line 948: 
Line 949: ##
Line 950: # @HostStatus:


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-09 Thread danken
Dan Kenigsberg has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 2:

(1 comment)


File vdsm/gluster/api.py
Line 211: def hostAdd(self, hostName, options=None):
Line 212: self.svdsmProxy.glusterPeerProbe(hostName)
Line 213: 
Line 214: @exportAsVerb
Line 215: def hostRemove(self, hostName, force=False, options={}):
please avoid mutable arguments like {}. They a function execution to affect a 
following execution.
Line 216: host = None
Line 217: hostUuid = options.get('hostUuid')
Line 218: 
Line 219: # get hostname of given host uuid


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-07 Thread dnarayan
Darshan N has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 2: Verified+1

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-11-06 Thread avishwan
Aravinda VK has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 2: Code-Review+1

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-10-31 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 2:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4348/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5152/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5227/ : SUCCESS

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-10-31 Thread dnarayan
Darshan N has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 1:

(1 comment)


File vdsm/gluster/api.py
Line 222: if(hostInfo['uuid'] == hostUuid):
Line 223: host = hostInfo['hostname']
Line 224: break
Line 225: if not host:
Line 226: logging.debug("Host with UUID:%s not found " % 
hostUuid)
Done
Line 227: host = hostName
Line 228: else:
Line 229: host = hostName
Line 230: 


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Darshan N 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-10-31 Thread avishwan
Aravinda VK has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 1: Code-Review-1

(2 comments)


File vdsm/gluster/api.py
Line 213: 
Line 214: @exportAsVerb
Line 215: def hostRemove(self, hostName, force=False, options={}):
Line 216: host = None
Line 217: hostUuid = options.get('hostUuid')
Sorry. This method will not work with new engine and old vdsm.
Line 218: 
Line 219: # get hostname of given host uuid
Line 220: if hostUuid:
Line 221: for hostInfo in self.svdsmProxy.glusterPeerStatus():


Line 222: if(hostInfo['uuid'] == hostUuid):
Line 223: host = hostInfo['hostname']
Line 224: break
Line 225: if not host:
Line 226: logging.debug("Host with UUID:%s not found " % 
hostUuid)
Avoid using global "logging", refer hooks.py for logging usage.

Use logging warn/error, since debug messages will be disabled in production use
Line 227: host = hostName
Line 228: else:
Line 229: host = hostName
Line 230: 


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-10-30 Thread avishwan
Aravinda VK has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 1:

(1 comment)


File vdsm/gluster/api.py
Line 213: 
Line 214: @exportAsVerb
Line 215: def hostRemove(self, hostName, force=False, options={}):
Line 216: host = None
Line 217: hostUuid = options.get('hostUuid')
One more option. how about using UUID validation to decide input value.

hostUuid = ""
try:
hostUuid = str(uuid.UUID(hostName))
except ValueError:
pass

This eliminates modification to existing function signature.
Line 218: 
Line 219: # get hostname of given host uuid
Line 220: if hostUuid:
Line 221: for hostInfo in self.svdsmProxy.glusterPeerStatus():


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Aravinda VK 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: Timothy Asir 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-10-29 Thread oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.

Change subject: gluster: performs peer detach using host UUID if provided
..


Patch Set 1:

Build Successful 

http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5115/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4311/ : SUCCESS

http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5189/ : SUCCESS

-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Bala.FA 
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[master]: gluster: performs peer detach using host UUID if provided

2013-10-29 Thread dnarayan
Hello Bala.FA,

I'd like you to do a code review.  Please visit

http://gerrit.ovirt.org/20648

to review the following change.

Change subject: gluster: performs peer detach using host UUID if provided
..

gluster: performs peer detach using host UUID if provided

This patch adds an optional argument hostUuid to the verb
glusterHostRemove. If hostUuid is provided then host
corresponding to uuid will be removed.

Signed-off-by: ndarshan 
Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
---
M client/vdsClientGluster.py
M vdsm/gluster/api.py
M vdsm/gluster/vdsmapi-gluster-schema.json
3 files changed, 42 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/20648/1

diff --git a/client/vdsClientGluster.py b/client/vdsClientGluster.py
index 3c1199c..42bbe06 100644
--- a/client/vdsClientGluster.py
+++ b/client/vdsClientGluster.py
@@ -151,8 +151,12 @@
 params = self._eqSplit(args)
 hostName = params.get('hostName', '')
 force = (params.get('force', 'no').upper() == 'YES')
-
-status = self.s.glusterHostRemove(hostName, force)
+hostUuid = params.get('hostUuid')
+if hostUuid is None:
+status = self.s.glusterHostRemove(hostName, force)
+else:
+status = self.s.glusterHostRemove(hostName, force,
+  {'hostUuid': hostUuid})
 return status['status']['code'], status['status']['message']
 
 def do_glusterVolumeReplaceBrickStart(self, args):
@@ -532,9 +536,10 @@
   )),
  'glusterHostRemove': (
  serv.do_glusterHostRemove,
- ('hostName= [force={yes|no}]\n\t'
+ ('hostName= [force={yes|no}] [hostUuid=]\n\t'
   ' is hostname or ip address of a server in '
-  'gluster cluster',
+  'gluster cluster'
+  'host UUID',
   'remove server from gluster cluster'
   )),
  'glusterVolumeReplaceBrickStart': (
diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 284fa97..07cd25d 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -19,9 +19,11 @@
 #
 
 from functools import wraps
+import logging
 
 from vdsm.define import doneCode
 import supervdsm as svdsm
+
 
 _SUCCESS = {'status': doneCode}
 
@@ -210,8 +212,23 @@
 self.svdsmProxy.glusterPeerProbe(hostName)
 
 @exportAsVerb
-def hostRemove(self, hostName, force=False, options=None):
-self.svdsmProxy.glusterPeerDetach(hostName, force)
+def hostRemove(self, hostName, force=False, options={}):
+host = None
+hostUuid = options.get('hostUuid')
+
+# get hostname of given host uuid
+if hostUuid:
+for hostInfo in self.svdsmProxy.glusterPeerStatus():
+if(hostInfo['uuid'] == hostUuid):
+host = hostInfo['hostname']
+break
+if not host:
+logging.debug("Host with UUID:%s not found " % hostUuid)
+host = hostName
+else:
+host = hostName
+
+self.svdsmProxy.glusterPeerDetach(host, force)
 
 @exportAsVerb
 def hostsList(self, options=None):
diff --git a/vdsm/gluster/vdsmapi-gluster-schema.json 
b/vdsm/gluster/vdsmapi-gluster-schema.json
index f45a438..3fb5be4 100644
--- a/vdsm/gluster/vdsmapi-gluster-schema.json
+++ b/vdsm/gluster/vdsmapi-gluster-schema.json
@@ -920,6 +920,19 @@
  'returns': 'bool'}
 
 ##
+# @HostOptions:
+#
+# List of host options.
+#
+# @hostUuid:  The Uuid of the host
+#
+# Since: 4.10.3
+##
+{'type': 'HostOptions',
+ 'data': {'hostUuid': 'UUID'}}
+
+
+##
 # @GlusterHost.remove:
 #
 # Remove Gluster Host
@@ -930,7 +943,7 @@
 # Since: 4.10.3
 ##
 {'command': {'class': 'GlusterHost', 'name': 'remove'},
- 'data': {'hostName': 'str', 'force': 'bool'},
+ 'data': {'hostName': 'str', 'force': 'bool', 'options': 'HostOptions'}
  'returns': 'bool'}
 
 ##


-- 
To view, visit http://gerrit.ovirt.org/20648
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfff258ccc43c276ca7b9c0472dacac2fefce64a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Darshan N 
Gerrit-Reviewer: Bala.FA 
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches