Commit 8ffc3615 authored by Jing Xu's avatar Jing Xu

AttachDisk should not call detach inside of Cinder volume provider

This PR fixes #50038 which removes the detach call inside of AttachDisk.
parent 2c624e59
...@@ -230,11 +230,9 @@ func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error) { ...@@ -230,11 +230,9 @@ func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error) {
glog.V(4).Infof("Disk %s is already attached to instance %s", volumeID, instanceID) glog.V(4).Infof("Disk %s is already attached to instance %s", volumeID, instanceID)
return volume.ID, nil return volume.ID, nil
} }
glog.V(2).Infof("Disk %s is attached to a different instance (%s), detaching", volumeID, volume.AttachedServerId) errmsg := fmt.Sprintf("Disk %s is attached to a different instance (%s)", volumeID, volume.AttachedServerId)
err = os.DetachDisk(volume.AttachedServerId, volumeID) glog.V(2).Infof(errmsg)
if err != nil { return "", errors.New(errmsg)
return "", err
}
} }
startTime := time.Now() startTime := time.Now()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment