How to use the eliot.Message.new function in eliot

To help you get started, we’ve selected a few eliot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ClusterHQ / flocker / flocker / acceptance / testtools.py View on Github external
def failed(failure):
            Message.new(message_type=u"acceptance:http_query_failed",
                        reason=unicode(failure)).write()
            return False
        req.addCallbacks(content, failed)
github ClusterHQ / flocker / flocker / node / agents / ebs.py View on Github external
def emit(self, record):
        Message.new(
            message_type=BOTO_LOG_HEADER, message=record.getMessage()
        ).write()
github CoprHD / coprhd-controller / tools / coprhd-flocker-driver / coprhd_flocker_plugin / coprhd_blockdevice.py View on Github external
def resize_volume(self, blockdevice_id, size):
        Message.new(Debug="coprhd resize_volume invoked").write(_logger)
        pass
github ClusterHQ / flocker / flocker / provision / _libcloud.py View on Github external
def _cleanup_node_named(self, name):
        """
        Destroy a node with the given name, if there is one.  Otherwise, do
        nothing.
        """
        nodes = _retry_exception(self._driver.list_nodes)
        for node in nodes:
            if node.name == name:
                Message.new(
                    message_type=(
                        u"flocker:provision:libcloud:cleanup_node_named"
                    ),
                    name=name,
                    id=node.id,
                    state=node.state,
                ).write()
                _retry_exception(node.destroy)
                return
github CoprHD / coprhd-controller / tools / coprhd-flocker-driver / coprhd_flocker_plugin / coprhd_blockdevice.py View on Github external
def destroy_volume(self, blockdevice_id):
        """
        Destroy the storage for the given unattached volume.
        :param: blockdevice_id - the volume id
        :raise: UnknownVolume is not found
        """
        dataset_id = UUID(blockdevice_id[6:])
        volumesdetails = self.coprhdcli.get_volume_details("flocker-{}".format(dataset_id))
        if not volumesdetails:
         raise UnknownVolume(blockdevice_id)
        Message.new(Info="Destroying Volume" + str(blockdevice_id)).write(_logger)
        self.coprhdcli.delete_volume("flocker-{}".format(dataset_id))
github CoprHD / coprhd-controller / tools / coprhd-flocker-driver / coprhd_flocker_plugin / coprhd_blockdevice.py View on Github external
def create_network(self,name,nwtype):
        self.authenticate_user()
        try:
            networkId = self.network_obj.query_by_name(name)
            if(networkId):
             Message.new(Debug="Network Already Exists").write(_logger)
            else: 
             self.network_obj.create(name,nwtype)
            varray_uri = self.varray_obj.varray_list()
            storage_ports = self.varray_obj.list_storageports(self.varray)
            storagesystem_name = []
            storagesystem_list = []
            port_list = []
            for st in storage_ports:
                if st['storage_system'] not in storagesystem_name:
                   storagesystem_name.append(st['storage_system'])
                   storagesystem_list.append(self.storagesystem_obj.show_by_name(st['storage_system']))
            for st in storagesystem_list:
                storage_port=self.storageport_obj.storageport_list(
                   storagedeviceName=st['name'],
                   serialNumber=st['serial_number'],
                   storagedeviceType=st['system_type'])
github CoprHD / coprhd-controller / tools / coprhd-flocker-driver / coprhd_flocker_plugin / coprhd_blockdevice.py View on Github external
attachment, the device shall appear in /dev/sd<1>.
        See ``IBlockDeviceAPI.attach_volume`` for parameter and return type
        documentation.
        """
        Message.new(Debug="coprhd attach_volume invoked").write(_logger)
        dataset_id = UUID(blockdevice_id[6:])
        volumesdetails = self.coprhdcli.get_volume_details("flocker-{}".format(dataset_id))
        Message.new(Info="coprhd got volume details").write(_logger)
        if not volumesdetails:
         raise UnknownVolume(blockdevice_id)
         
        if volumesdetails[volumesdetails.keys()[0]]['attached_to'] is not None:
           Message.new(Info="coprhd already attached volume").write(_logger)
           raise AlreadyAttachedVolume(blockdevice_id)
        else:
           Message.new(Info="coprhd invoking export_volume").write(_logger)
           self.coprhdcli.export_volume("flocker-{}".format(dataset_id))
        self.rescan_scsi()
        size = Decimal(volumesdetails[volumesdetails.keys()[0]]['size'])
        size = 1073741824 * int(size)
        return BlockDeviceVolume(
          size=size, attached_to=attach_to,
          dataset_id=dataset_id,
          blockdevice_id=blockdevice_id,
        )
github ClusterHQ / flocker / flocker / common / _retry.py View on Github external
def pollable():
        Message.new(
            message_type=_TRY_RETRYING,
        ).write()
        try:
            result = function(*args, **kwargs)
        except Exception as e:
            saved_result[0] = exc_info()
            should_retry(*saved_result[0])
            Message.new(
                message_type=_TRY_FAILURE,
                exception=str(e),
            ).write()
            return False
        else:
            Message.new(
                message_type=_TRY_SUCCESS,
                result=result,
            ).write()
            saved_result[0] = result
            return True
github thecodeteam / flocker-drivers / scaleio / scaleio_flocker_driver / emc_sio.py View on Github external
# Convert bytes to megabytes for API
        mb_size = bytes_to_mbytes(size)
        scaleio_size = self.to_scaleio_size(mb_size)

        # Flocker volumes start with and f again,
        # we only have 32 chars to work with in the ```name```
        volume_name = 'f%s%s' % (slug, str(self._cluster_id)[:8])
        volume = self._client.create_volume(
            volume_name,
            scaleio_size,
            self._client.get_pd_by_name(self._pdomain),
            self._client.get_storage_pool_by_name(self._spool))

        siovolume = self._client.get_volume_by_name(
            volume_name)
        Message.new(Info="Created Volume "
                    + siovolume.name).write(_logger)
        Message.new(vol=siovolume.id,
                    size=siovolume.size_kb).write(_logger)

        return _blockdevicevolume_from_scaleio_volume(
            self._client.get_volume_by_name(volume_name))
github ClusterHQ / flocker / flocker / provision / _aws.py View on Github external
def _check_response_error(e, message_type):
    """
    Check if an exception is a transient one.
    If it is, then it is simply logged, otherwise it is raised.

    :param boto.exception import EC2ResponseErro e: The exception to check.
    :param str message_type: The message type for logging.
    """
    if e.error_code != BOTO_INSTANCE_NOT_FOUND:
        raise e
    Message.new(
        message_type=message_type,
        reason=e.error_code,
    ).write()