def attachments(self): if self._volume.attachments: return BaseAttachmentInfo( self, self._volume.attachments[0].get('server_id'), self._volume.attachments[0].get('device')) else: return None
def attachments(self): """ Azure does not have option to specify the device name while attaching disk to VM. It is automatically populated and is not returned. As a result this method ignores the device name parameter and passes None to the BaseAttachmentInfo :return: """ if self._volume.managed_by: return BaseAttachmentInfo(self, self._volume.managed_by, None) else: return None
def attachments(self): return [ BaseAttachmentInfo(self, a.get('InstanceId'), a.get('Device')) for a in self._volume.attachments ][0] if self._volume.attachments else None