-
Notifications
You must be signed in to change notification settings - Fork 82
Check whether peer has devices before removing peer #1421
base: master
Are you sure you want to change the base?
Conversation
Signedoff-by: rishubhjain <[email protected]>
Fixes : #1422 |
Please review, but this should be merged after #1120 |
dev, err := client.DeviceList(g2.PeerID(), "/dev/gluster_loop1") | ||
r.Nil(err) | ||
r.Equal(dev[0].Device, "/dev/gluster_loop1") | ||
|
||
err = client.PeerRemove(g2.PeerID()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once the peer remove failed, please remove the device and then try removing the peer again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove the device once the delete device PR is in. Let's wait for the PR(#1120) to get merged.
@@ -43,3 +43,11 @@ func (c *Client) DeviceEdit(peerid, device, state string) error { | |||
err := c.post(url, req, http.StatusOK, nil) | |||
return err | |||
} | |||
|
|||
// DevicesInPeer lists devices in peer | |||
func (c *Client) DevicesInPeer(peerid string) (deviceapi.ListDeviceResp, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is needed?
we already have an API to do this functionality. https://github.com/gluster/glusterd2/blob/master/pkg/restclient/device.go#L26
No description provided.