Beispiel #1
0
 def _query_snapshot(self, snapshot_name):
     request_info = {"snap_name": snapshot_name}
     request_type = "QUERY_SNAPSHOT_REQ"
     rsp_str = self._vbs_client.send_message(storhyper_utils.serialize(request_type, request_info))
     LOG.debug("%s received:%s." % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str), delimiter="\n")
     storhyper_utils.log_dict(result)
     return result
Beispiel #2
0
 def _query_volume(self, volume_name):
     request_info = {"vol_name": volume_name}
     request_type = "QUERY_VOLUME_REQ"
     rsp_str = self._vbs_client.send_message(storhyper_utils.serialize(request_type, request_info))
     LOG.debug("%s received:%s." % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str), delimiter="\n")
     storhyper_utils.log_dict(result)
     return result
Beispiel #3
0
 def _send_request(self, request_type, request_info, error_message):
     rsp_str = self._vbs_client.send_message(storhyper_utils.serialize(request_type, request_info))
     LOG.debug("%s received:%s." % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str), delimiter="\n")
     storhyper_utils.log_dict(result)
     if len(result) < 0 or "retcode" not in result or result["retcode"] != "0":
         msg = _("%(err)s\n") % {"err": error_message}
         raise exception.VolumeBackendAPIException(data=msg)
     return result
Beispiel #4
0
 def _query_snapshot(self, snapshot_name):
     request_info = {'snap_name': snapshot_name}
     request_type = 'QUERY_SNAPSHOT_REQ'
     rsp_str = self._vbs_client.send_message(
         storhyper_utils.serialize(request_type, request_info))
     LOG.debug('%s received:%s.' % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str),
                                          delimiter='\n')
     storhyper_utils.log_dict(result)
     return result
Beispiel #5
0
 def _query_volume(self, volume_name):
     request_info = {'vol_name': volume_name}
     request_type = 'QUERY_VOLUME_REQ'
     rsp_str = self._vbs_client.send_message(
         storhyper_utils.serialize(request_type, request_info))
     LOG.debug('%s received:%s.' % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str),
                                          delimiter='\n')
     storhyper_utils.log_dict(result)
     return result
Beispiel #6
0
 def _send_request(self, request_type, request_info, error_message):
     rsp_str = self._vbs_client.send_message(
         storhyper_utils.serialize(request_type, request_info))
     LOG.debug('%s received:%s.' % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str),
                                          delimiter='\n')
     storhyper_utils.log_dict(result)
     if (len(result) < 0 or 'retcode' not in result
             or result['retcode'] != '0'):
         msg = _('%(err)s\n') % {'err': error_message}
         raise exception.VolumeBackendAPIException(data=msg)
     return result
Beispiel #7
0
 def _send_request(self, request_type, request_info, error_message):
     rsp_str = self._vbs_client.send_message(
         storhyper_utils.serialize(request_type, request_info))
     LOG.debug('%s received:%s.' % (request_type, repr(rsp_str)))
     result = storhyper_utils.deserialize(six.text_type(rsp_str),
                                          delimiter='\n')
     storhyper_utils.log_dict(result)
     if (len(result) < 0 or 'retcode' not in result
             or result['retcode'] != '0'):
         msg = _('%(err)s\n') % {'err': error_message}
         raise exception.VolumeBackendAPIException(data=msg)
     return result