text
stringlengths
81
112k
Return user information in a pretty way def _format_info(data): ''' Return user information in a pretty way ''' # Put GECOS info into a list gecos_field = salt.utils.stringutils.to_unicode(data.pw_gecos).split(',', 4) # Make sure our list has at least five elements while len(gecos_field) < ...
Return a list of all users root Directory to chroot into CLI Example: .. code-block:: bash salt '*' user.list_users def list_users(root=None): ''' Return a list of all users root Directory to chroot into CLI Example: .. code-block:: bash salt '*' ...
Change the username for a named user name User to modify new_name New value of the login name root Directory to chroot into CLI Example: .. code-block:: bash salt '*' user.rename name new_name def rename(name, new_name, root=None): ''' Change the userna...
Alternative implementation for getpwnam, that use only /etc/passwd def _getpwnam(name, root=None): ''' Alternative implementation for getpwnam, that use only /etc/passwd ''' root = '/' if not root else root passwd = os.path.join(root, 'etc/passwd') with salt.utils.files.fopen(passwd) as fp_: ...
Add a range of subordinate gids to the user name User to modify first Begin of the range last End of the range CLI Examples: .. code-block:: bash salt '*' user.add_subgids foo salt '*' user.add_subgids foo first=105000 salt '*' user.add_subgids f...
Install a DISM capability Args: name (str): The capability to install source (str): The optional source of the capability limit_access (bool): Prevent DISM from contacting Windows Update for online images image (Optional[str]): The path to the root directory of an offlin...
Uninstall a package Args: name (str): The full path to the package. Can be either a .cab file or a folder. Should point to the original source of the package, not to where the file is installed. This can also be the name of a package as listed in ``dism.installed_package...
Performs an ICMP ping to a host .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.ping archlinux.org .. versionadded:: 2015.5.0 Return a True or False instead of ping output. .. code-block:: bash salt '*' netwo...
Return netstat information for Linux distros def _netstat_linux(): ''' Return netstat information for Linux distros ''' ret = [] cmd = 'netstat -tulpnea' out = __salt__['cmd.run'](cmd) for line in out.splitlines(): comps = line.split() if line.startswith('tcp'): ...
Return ss information for Linux distros (netstat is deprecated and may not be available) def _ss_linux(): ''' Return ss information for Linux distros (netstat is deprecated and may not be available) ''' ret = [] cmd = 'ss -tulpnea' out = __salt__['cmd.run'](cmd) for line in out.spli...
Get process information for network connections using fstat def _netinfo_openbsd(): ''' Get process information for network connections using fstat ''' ret = {} _fstat_re = re.compile( r'internet(6)? (?:stream tcp 0x\S+ (\S+)|dgram udp (\S+))' r'(?: [<>=-]+ (\S+))?$' ) out =...
Get process information for network connections using sockstat def _netinfo_freebsd_netbsd(): ''' Get process information for network connections using sockstat ''' ret = {} # NetBSD requires '-n' to disable port-to-service resolution out = __salt__['cmd.run']( 'sockstat -46 {0} | tail ...
Return a dict of pid to ppid mappings def _ppid(): ''' Return a dict of pid to ppid mappings ''' ret = {} if __grains__['kernel'] == 'SunOS': cmd = 'ps -a -o pid,ppid | tail +2' else: cmd = 'ps -ax -o pid,ppid | tail -n+2' out = __salt__['cmd.run'](cmd, python_shell=True) ...
Return netstat information for BSD flavors def _netstat_bsd(): ''' Return netstat information for BSD flavors ''' ret = [] if __grains__['kernel'] == 'NetBSD': for addr_family in ('inet', 'inet6'): cmd = 'netstat -f {0} -an | tail -n+3'.format(addr_family) out = __sa...
Return netstat information for SunOS flavors def _netstat_sunos(): ''' Return netstat information for SunOS flavors ''' log.warning('User and program not (yet) supported on SunOS') ret = [] for addr_family in ('inet', 'inet6'): # Lookup TCP connections cmd = 'netstat -f {0} -P ...
Return netstat information for SunOS flavors def _netstat_aix(): ''' Return netstat information for SunOS flavors ''' ret = [] ## AIX 6.1 - 7.2, appears to ignore addr_family field contents ## for addr_family in ('inet', 'inet6'): for addr_family in ('inet',): # Lookup connections ...
Return ip routing information for Linux distros (netstat is deprecated and may not be available) def _ip_route_linux(): ''' Return ip routing information for Linux distros (netstat is deprecated and may not be available) ''' # table main closest to old netstat inet output ret = [] cmd =...
Return netstat routing information for FreeBSD and macOS def _netstat_route_freebsd(): ''' Return netstat routing information for FreeBSD and macOS ''' ret = [] cmd = 'netstat -f inet -rn | tail -n+5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): co...
Return netstat routing information for NetBSD def _netstat_route_netbsd(): ''' Return netstat routing information for NetBSD ''' ret = [] cmd = 'netstat -f inet -rn | tail -n+5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() ...
Return netstat routing information for SunOS def _netstat_route_sunos(): ''' Return netstat routing information for SunOS ''' ret = [] cmd = 'netstat -f inet -rn | tail +5' out = __salt__['cmd.run'](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() r...
Return information on open ports and states .. note:: On BSD minions, the output contains PID info (where available) for each netstat entry, fetched from sockstat/fstat output. .. versionchanged:: 2014.1.4 Added support for OpenBSD, FreeBSD, and NetBSD .. versionchanged:: 2015.8.0...
Return a dict containing information on all of the running TCP connections (currently linux and solaris only) .. versionchanged:: 2015.8.4 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.active_tcp def active_tcp(): ''' Return a dict containing inform...
Performs a traceroute to a 3rd party host .. versionchanged:: 2015.8.0 Added support for SunOS .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' network.traceroute archlinux.org def traceroute(host): ''' Performs a tracer...
Performs a DNS lookup with dig CLI Example: .. code-block:: bash salt '*' network.dig archlinux.org def dig(host): ''' Performs a DNS lookup with dig CLI Example: .. code-block:: bash salt '*' network.dig archlinux.org ''' cmd = 'dig {0}'.format(salt.utils.network....
Return the arp table from the minion .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example: .. code-block:: bash salt '*' network.arp def arp(): ''' Return the arp table from the minion .. versionchanged:: 2015.8.0 Added support for SunOS CLI Example...
returns the network address, subnet mask and broadcast address of a cidr address .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt '*' network.convert_cidr 172.31.0.0/16 def convert_cidr(cidr): ''' returns the network address, subnet mask and broadcast address of a cidr ...
Modify hostname .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) CLI Example: .. code-block:: bash salt '*' network.mod_hostname master.saltstack.com def mod_hostname(hostname): ''' Modify hostname .. versionchanged:: 2015.8.0 Adde...
Return network interface buffer information using ethtool def _get_bufsize_linux(iface): ''' Return network interface buffer information using ethtool ''' ret = {'result': False} cmd = '/sbin/ethtool -g {0}'.format(iface) out = __salt__['cmd.run'](cmd) pat = re.compile(r'^(.+):\s+(\d+)$') ...
Modify network interface buffer sizes using ethtool def _mod_bufsize_linux(iface, *args, **kwargs): ''' Modify network interface buffer sizes using ethtool ''' ret = {'result': False, 'comment': 'Requires rx=<val> tx==<val> rx-mini=<val> and/or rx-jumbo=<val>'} cmd = '/sbin/ethtool -G ' ...
Modify network interface buffers (currently linux only) CLI Example: .. code-block:: bash salt '*' network.mod_bufsize tx=<val> rx=<val> rx-mini=<val> rx-jumbo=<val> def mod_bufsize(iface, *args, **kwargs): ''' Modify network interface buffers (currently linux only) CLI Example: .....
Return currently configured routes from routing table .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' network.routes def routes(family=None): ...
Return default route(s) from routing table .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) .. versionchanged:: 2016.11.4 Added support for AIX CLI Example: .. code-block:: bash salt '*' network.default_route def default_route(family=None)...
Return routing information for given destination ip .. versionadded:: 2015.5.3 .. versionchanged:: 2015.8.0 Added support for SunOS (Solaris 10, Illumos, SmartOS) Added support for OpenBSD .. versionchanged:: 2016.11.4 Added support for AIX CLI Example:: salt '*' net...
Retrieve the interface name from a specific CIDR .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.ifacestartswith 10.0 def ifacestartswith(cidr): ''' Retrieve the interface name from a specific CIDR .. versionadded:: 2016.11.0 CLI Example: .....
Retrieve the hexadecimal representation of an IP address .. versionadded:: 2016.11.0 CLI Example: .. code-block:: bash salt '*' network.iphexval 10.0.0.1 def iphexval(ip): ''' Retrieve the hexadecimal representation of an IP address .. versionadded:: 2016.11.0 CLI Example: ...
Ensure trail exists. name The name of the state definition Name Name of the event rule. Defaults to the value of the 'name' param if not provided. ScheduleExpression The scheduling expression. For example, ``cron(0 20 * * ? *)``, "rate(5 minutes)" EventPatter...
Ensure CloudWatch event rule with passed properties is absent. name The name of the state definition. Name Name of the event rule. Defaults to the value of the 'name' param if not provided. region Region to connect to. key Secret key to be used. keyid ...
Return a list of nodes :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_nodes method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list_nodes profile1 def list_n...
Return a list of node sizes :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_sizes method :type libcloud_kwargs: ``dict`` CLI Exampl...
Return a list of locations for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_locations method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list_loc...
Reboot a node in the cloud :param node_id: Unique ID of the node to reboot :type node_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's reboot_node method :type libcloud_kwargs: ``dict`` CLI Example: .. cod...
Return a list of storage volumes for this cloud :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_volumes method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list...
Return a list of storage volumes snapshots for this cloud :param volume_id: The volume identifier :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_volume_snapshots method :type libcloud_kwargs: ``d...
Create a storage volume :param size: Size of volume in gigabytes (required) :type size: ``int`` :param name: Name of the volume to be created :type name: ``str`` :param location_id: Which data center to create a volume in. If empty, undefined behavior will be selected....
Create a storage volume snapshot :param volume_id: Volume ID from which to create the new snapshot. :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param name: Name of the snapshot to be created (optional) :type name: ``str`` :p...
Attaches volume to node. :param node_id: Node ID to target :type node_id: ``str`` :param volume_id: Volume ID from which to attach :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param device: Where the device is exposed, e.g. '/dev/sdb' :type de...
Detaches a volume from a node. :param volume_id: Volume ID from which to detach :type volume_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's detach_volume method :type libcloud_kwargs: ``dict`` CLI Example: ...
Destroy a volume snapshot. :param volume_id: Volume ID from which the snapshot belongs :type volume_id: ``str`` :param snapshot_id: Volume Snapshot ID from which to destroy :type snapshot_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extr...
Return a list of images for this cloud :param profile: The profile key :type profile: ``str`` :param location_id: The location key, from list_locations :type location_id: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_images method :type libcloud_kwargs: ``dict`` ...
Create an image from a node :param node_id: Node to run the task on. :type node_id: ``str`` :param name: name for new image. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param description: description for new image. :type description: ``description`` ...
Delete an image of a node :param image_id: Image to delete :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash ...
Get an image of a node :param image_id: Image to fetch :type image_id: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's delete_image method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash ...
Copies an image from a source region to the current region. :param source_region: Region to copy the node from. :type source_region: ``str`` :param image_id: Image to copy. :type image_id: ``str`` :param name: name for new image. :type name: ``str`` :param profile: The profile key :t...
List all the available key pair objects. :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's list_key_pairs method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash salt myminion libcloud_compute.list_key_...
Get a single key pair by name :param name: Name of the key pair to retrieve. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's get_key_pair method :type libcloud_kwargs: ``dict`` CLI Example: .. code...
Import a new public key from string or a file path :param name: Key pair name. :type name: ``str`` :param key: Public key material, the string or a path to a file :type key: ``str`` or path ``str`` :param profile: The profile key :type profile: ``str`` :param key_type: The key pair typ...
Delete a key pair :param name: Key pair name. :type name: ``str`` :param profile: The profile key :type profile: ``str`` :param libcloud_kwargs: Extra arguments for the driver's import_key_pair_from_xxx method :type libcloud_kwargs: ``dict`` CLI Example: .. code-block:: bash ...
Get item from a list by the id field def _get_by_id(collection, id): ''' Get item from a list by the id field ''' matches = [item for item in collection if item.id == id] if not matches: raise ValueError('Could not find a matching item') elif len(matches) > 1: raise ValueError('...
Get the summary from module monit and try to see if service is being monitored. If not then monitor the service. def monitor(name): ''' Get the summary from module monit and try to see if service is being monitored. If not then monitor the service. ''' ret = {'result': None, 'name': ...
Get status of running jboss instance. jboss_config Configuration dictionary with properties specified above. host The name of the host. JBoss domain mode only - and required if running in domain mode. The host name is the "name" attribute of the "host" element in host.xml server_con...
Stop running jboss instance jboss_config Configuration dictionary with properties specified above. host The name of the host. JBoss domain mode only - and required if running in domain mode. The host name is the "name" attribute of the "host" element in host.xml CLI Example: ....
Reload running jboss instance jboss_config Configuration dictionary with properties specified above. host The name of the host. JBoss domain mode only - and required if running in domain mode. The host name is the "name" attribute of the "host" element in host.xml CLI Example: ...
Create datasource in running jboss instance jboss_config Configuration dictionary with properties specified above. name Datasource name datasource_properties A dictionary of datasource properties to be created: - driver-name: mysql - connection-url: 'jdbc:mysql:/...
Update an existing datasource in running jboss instance. If the property doesn't exist if will be created, if it does, it will be updated with the new value jboss_config Configuration dictionary with properties specified above. name Datasource name new_properties A dictionary of...
Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode only) CLI Example: .. code-block:: bash salt '*' jboss7.read_datasource '{...
Create a simple jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created value Binding value profile The profile name (JBoss domain mode only) CLI Example: .. code-...
Read jndi binding in the running jboss instance jboss_config Configuration dictionary with properties specified above. binding_name Binding name to be created profile The profile name (JBoss domain mode only) CLI Example: .. code-block:: bash salt '*' jboss7.r...
Remove an existing datasource from the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile The profile (JBoss domain mode only) CLI Example: .. code-block:: bash salt '*' jboss7.remove_datasou...
Deploy the application on the jboss instance from the local file system where minion is running. jboss_config Configuration dictionary with properties specified above. source_file Source file to deploy from CLI Example: .. code-block:: bash salt '*' jboss7.deploy '{"cli_path"...
List all deployments on the jboss instance jboss_config Configuration dictionary with properties specified above. CLI Example: .. code-block:: bash salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:999...
Undeploy the application from jboss instance jboss_config Configuration dictionary with properties specified above. deployment Deployment name to undeploy CLI Example: .. code-block:: bash salt '*' jboss7.undeploy '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_v...
Computes the timestamp for a future event that may occur in ``time_in`` time or at ``time_at``. def get_timestamp_at(time_in=None, time_at=None): ''' Computes the timestamp for a future event that may occur in ``time_in`` time or at ``time_at``. ''' if time_in: if isinstance(time_in, in...
Return the time in human readable format for a future event that may occur in ``time_in`` time, or at ``time_at``. def get_time_at(time_in=None, time_at=None, out_fmt='%Y-%m-%dT%H:%M:%S'): ''' Return the time in human readable format for a future event that may occur in ``time_in`` time, or at ``time_a...
Return a bool telling whether or ``path`` is absolute. If ``path`` is None, return ``True``. This function is designed to validate variables which optionally contain a file path. def _path_is_abs(path): ''' Return a bool telling whether or ``path`` is absolute. If ``path`` is None, return ``True``....
.. versionadded:: 2014.1.0 .. versionchanged:: 2016.11.0 This state has been rewritten. Some arguments are new to this release and will not be available in the 2016.3 release cycle (and earlier). Additionally, the **ZIP Archive Handling** section below applies specifically to the 201...
Get the status of all the firewall profiles Returns: dict: A dictionary of all profiles on the system Raises: CommandExecutionError: If the command fails CLI Example: .. code-block:: bash salt '*' firewall.get_config def get_config(): ''' Get the status of all the f...
.. versionadded:: 2015.5.0 Enable firewall profile Args: profile (Optional[str]): The name of the profile to enable. Default is ``allprofiles``. Valid options are: - allprofiles - domainprofile - privateprofile - publicprofile Returns: ...
.. versionadded:: 2015.5.0 Display all matching rules as specified by name Args: name (Optional[str]): The full name of the rule. ``all`` will return all rules. Default is ``all`` Returns: dict: A dictionary of all rules or rules that match the name exactly Raises: ...
.. versionadded:: 2015.5.0 Add a new inbound or outbound rule to the firewall policy Args: name (str): The name of the rule. Must be unique and cannot be "all". Required. localport (int): The port the rule applies to. Must be a number between 0 and 65535. Can be a ran...
.. versionadded:: 2015.8.0 Delete an existing firewall rule identified by name and optionally by ports, protocols, direction, and remote IP. Args: name (str): The name of the rule to delete. If the name ``all`` is used you must specify additional parameters. localport (Option...
Get the firewall property from the specified profile in the specified store as returned by ``netsh advfirewall``. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to query. Valid options are: - domain - public...
Gets all the properties for the specified profile in the specified store .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to query. Valid options are: - domain - public - private store (str): ...
Set the firewall inbound/outbound settings for the specified profile and store .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to query. Valid options are: - domain - public - private inb...
r''' Configure logging settings for the Windows firewall. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to configure. Valid options are: - domain - public - private setting (str): ...
Configure firewall settings. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to configure. Valid options are: - domain - public - private setting (str): The firewall setting to co...
Configure the firewall state. .. versionadded:: 2018.3.4 .. versionadded:: 2019.2.0 Args: profile (str): The firewall profile to configure. Valid options are: - domain - public - private state (str): The firewall state. Valid o...
Return the error line and error message output from a stacktrace. If we are in a macro, also output inside the message the exact location of the error in the macro def _get_jinja_error(trace, context=None): ''' Return the error line and error message output from a stacktrace. If we are in a...
Render a Genshi template. A method should be passed in as part of the context. If no method is passed in, xml is assumed. Valid methods are: .. code-block: - xml - xhtml - html - text - newtext - oldtext Note that the ``text`` method will call ``NewTextTemp...
Render a Cheetah template. def render_cheetah_tmpl(tmplstr, context, tmplpath=None): ''' Render a Cheetah template. ''' from Cheetah.Template import Template return salt.utils.data.decode(Template(tmplstr, searchList=[context]))
Render a template from a python source file Returns:: {'result': bool, 'data': <Error data or rendered file path>} def py(sfn, string=False, **kwargs): # pylint: disable=C0103 ''' Render a template from a python source file Returns:: {'result': bool, 'data': <Erro...
Gets information about fund in the user's account. This method returns the following information: Available Balance, Account Balance, Earned Amount, Withdrawable Amount and Funds Required for AutoRenew. .. note:: If a domain setup with automatic renewal is expiring within the next 90 days, ...
Checks if the provided minimum value is present in the user's account. Returns a boolean. Returns ``False`` if the user's account balance is less than the provided minimum or ``True`` if greater than the minimum. minimum : 100 The value to check CLI Example: .. code-block:: bash ...
Return the ZeroMQ URI to connect the Minion to the Master. It supports different source IP / port, given the ZeroMQ syntax: // Connecting using a IP address and bind to an IP address rc = zmq_connect(socket, "tcp://192.168.1.17:5555;192.168.1.1:5555"); assert (rc == 0); Source: http://api.zeromq.org/4-1...
Ensure that TCP keepalives are set as specified in "opts". Warning: Failure to set TCP keepalives on the salt-master can result in not detecting the loss of a minion when the connection is lost or when it's host has been terminated without first closing the socket. Salt's Presence System depends on thi...
Send a load across the wire in cleartext :param dict load: A load to send across the wire :param int tries: The number of times to make before failure :param int timeout: The number of seconds on a response before failing def _uncrypted_transfer(self, load, tries=3, timeout=60): ''' ...
Send a request, return a future which will complete when we send the message def send(self, load, tries=3, timeout=60, raw=False): ''' Send a request, return a future which will complete when we send the message ''' if self.crypt == 'clear': ret = yield self._uncrypted_trans...
Return the master publish port def master_pub(self): ''' Return the master publish port ''' return _get_master_uri(self.opts['master_ip'], self.publish_port, source_ip=self.opts.get('source_ip'), ...
Take the zmq messages, decrypt/decode them into a payload :param list messages: A list of messages to be decoded def _decode_messages(self, messages): ''' Take the zmq messages, decrypt/decode them into a payload :param list messages: A list of messages to be decoded ''' ...
Return the current zmqstream, creating one if necessary def stream(self): ''' Return the current zmqstream, creating one if necessary ''' if not hasattr(self, '_stream'): self._stream = zmq.eventloop.zmqstream.ZMQStream(self._socket, io_loop=self.io_loop) return self...
Register a callback for received messages (that we didn't initiate) :param func callback: A function which should be called when data is received def on_recv(self, callback): ''' Register a callback for received messages (that we didn't initiate) :param func callback: A function which...