Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
r™EYc@sÛdZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZddlZddlZddlZddlZddlmZdZdZdZd	Zd
ZdZdZ d
Z!de"fd„ƒYZ#de#fd„ƒYZ$de#fd„ƒYZ%de#fd„ƒYZ&de#fd„ƒYZ'de#fd„ƒYZ(de#fd„ƒYZ)de#fd„ƒYZ*de#fd„ƒYZ+d e#fd!„ƒYZ,d"e#fd#„ƒYZ-d$e#fd%„ƒYZ.d&e#fd'„ƒYZ/d(e#fd)„ƒYZ0d*e#fd+„ƒYZ1d,„Z2d-efd.„ƒYZ3d/efd0„ƒYZ4d1efd2„ƒYZ5d3e6fd4„ƒYZ7d5ej8fd6„ƒYZ9d7Z:dd8„Z;d9e6fd:„ƒYZ<d;e6fd<„ƒYZ=d=e6fd>„ƒYZ>d?e6fd@„ƒYZ?dAe6fdB„ƒYZ@dCe6fdD„ƒYZAeeeeƒZBdEe6fdF„ƒYZCdG„ZDdH„ZEdIe6fdJ„ƒYZFdKdLdMdNdOdPdQgZGdRe6fdS„ƒYZHdS(Tsk
This module is a thin wrapper around librados.

Copyright 2011, Hannu Valtonen <hannu.valtonen@ormod.com>
iÿÿÿÿ(tCDLLtc_char_ptc_size_ttc_void_ptc_chartc_inttc_longtc_ulongtcreate_string_buffertbyreft	Structuretc_uint64tc_ubytetpointert	CFUNCTYPEtc_int64tc_uint32tc_uint8(tfind_libraryN(tdatetimelÿÿÿÿisiiii i@tErrorcBseZdZRS(s) `Error` class, derived from `Exception` (t__name__t
__module__t__doc__(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRstInterruptedOrTimeoutErrorcBseZdZRS(s9 `InterruptedOrTimeoutError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRstPermissionErrorcBseZdZRS(s/ `PermissionError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR"stObjectNotFoundcBseZdZRS(s. `ObjectNotFound` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR&stNoDatacBseZdZRS(s& `NoData` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR*stObjectExistscBseZdZRS(s, `ObjectExists` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR.st
ObjectBusycBseZdZRS(s* `ObjectBusy` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR2stIOErrorcBseZdZRS(s' `IOError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR6stNoSpacecBseZdZRS(s' `NoSpace` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR:stIncompleteWriteErrorcBseZdZRS(s4 `IncompleteWriteError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR >stRadosStateErrorcBseZdZRS(s/ `RadosStateError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR!BstIoctxStateErrorcBseZdZRS(s/ `IoctxStateError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR"FstObjectStateErrorcBseZdZRS(s0 `ObjectStateError` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR#Jst
LogicErrorcBseZdZRS(s  `` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR$NstTimedOutcBseZdZRS(s( `TimedOut` class, derived from `Error` (RRR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR%RscCs£i	ttj6ttj6ttj6ttj6t	tj
6ttj6t
tj6ttj6ttj6}t|ƒ}||kr†|||ƒSt|dtj|ƒSdS(sØ
    Translate a librados return code into an exception.

    :param ret: the return code
    :type ret: int
    :param msg: the error message to use
    :type msg: str
    :returns: a subclass of :class:`Error`
    s
: errno %sN(RterrnotEPERMRtENOENTRtEIORtENOSPCRtEEXISTRtEBUSYRtENODATARtEINTRR%t	ETIMEDOUTtabsRt	errorcode(trettmsgterrors((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytmake_exVs








trados_pool_stat_tc
Bs€eZdZdefdefdefdefdefdefdefdefd	efd
efdefdefgZRS(
s Usage information for a pool t	num_bytestnum_kbtnum_objectstnum_object_clonestnum_object_copiestnum_objects_missing_on_primarytnum_objects_unfoundtnum_objects_degradedtnum_rdt	num_rd_kbtnum_wrt	num_wr_kb(RRRRt_fields_(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR6rs											trados_cluster_stat_tcBs8eZdZdefdefdefdefgZRS(s  Cluster-wide usage information tkbtkb_usedtkb_availR9(RRRRRC(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRDs
			ttimevalcBs eZdefdefgZRS(ttv_secttv_usec(RRRRC(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRHˆstVersioncBs eZdZd„Zd„ZRS(s Version information cCs||_||_||_dS(N(tmajortminortextra(tselfRLRMRN((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__init__Žs		cCsd|j|j|jfS(Ns%d.%d.%d(RLRMRN(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__str__“s(RRRRPRQ(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRKŒs	tRadosThreadcBseZdd„Zd„ZRS(cCs&||_||_tjj|ƒdS(N(targsttargett	threadingtThreadRP(RORTRS((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRP—s		cCs|j|jŒ|_dS(N(RTRStretval(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytrunœsN(RRtNoneRPRX(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRR–sgà?cCsÇt}|}t||ƒ}t|_|jƒybxQ|jƒr„|jtƒ|r4|jƒr4|t}|dkrt‚qq4q4W|jƒWntk
r©t}nX|rÀt	j
|_n|jS(Ni(tFalseRRtTruetdaemontstarttis_alivetjointPOLL_TIME_INCRtKeyboardInterruptR&R.RW(RTRSttimeoutt	interruptt	countdowntt((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
run_in_thread¢s$	




tRadoscBs=eZdZd„Zdddddddd„Zd„Zd„Zd„Zd„Z	dd„Z
d	„Zd
d„Zd„Z
d
„Zd„Zdd„Zd„Zd„Zd„Zd„Zddd„Zd„Zd„Zd„Zd„Zd„Zddd„Zdd„Zdd„Zd„Zdd„ZRS( slibrados python wrappercGs*|j|krdStd|jƒ‚dS(sd
        Checks if the Rados object is in a special state

        :raises: RadosStateError
        Ns@You cannot perform that operation on a Rados object in state %s.(tstateR!(RORS((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
require_stateÇsicCsftdƒ}t|dk	r!|ndƒ|_g|_||_||_tƒ|_||_	|dk	rˆt
|tƒrˆtdƒ‚n|dk	r³t
|tƒr³tdƒ‚n|dk	rÞt
|tƒrÞtdƒ‚n|dk	r	t
|tƒr	tdƒ‚n|r$|r$t
dƒ‚n(|r7d|}n|dkrLd	}n|dkrad
}nt|jjt|jƒt|ƒt|ƒt|ƒfƒ}	|	dkr¼t
d|	ƒ‚nd
|_|rûx-|jƒD]\}
}|j|
|ƒqØWn|dk	r,|dkrd}n|j|ƒn|rbx-|jƒD]\}
}|j|
|ƒq?WndS(Ntradoss
librados.so.2s!rados_id must be a string or Nones!conffile must be a string or Nonesname must be a string or Nones$clustername must be a string or Nones,Rados(): can't supply both rados_id and namesclient.sclient.admintcephis+rados_initialize failed with error code: %dtconfiguringt(RRRYtlibradostparsed_argst
conf_defaultstconffileRtclustertrados_idt
isinstancetstrt	TypeErrorRRft
rados_create2R	RRRht	iteritemstconf_settconf_read_file(RORstnametclusternameRpRqtconftflagstlibrary_pathR2tkeytvalue((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRPÒsN!				
				cCsGt|dƒrC|jdkrCt|jj|jfƒd|_ndS(s€
        Disconnects from the cluster.  Call this explicitly when a
        Rados.connect()ed object is no longer used.
        RhtshutdownN(thasattrRhRfRntrados_shutdownRr(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR‚scCs|jƒ|S(N(tconnect(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt	__enter__s
cCs|jƒtS(N(R‚RZ(ROttype_Rt	traceback((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__exit__s
cCsktdƒ}tdƒ}tdƒ}t|jjt|ƒt|ƒt|ƒfƒt|j|j|jƒS(s´
        Get the version number of the ``librados`` C library.

        :returns: a tuple of ``(major, minor, extra)`` components of the
                  librados version
        i(RRfRnt
rados_versionR	RKR(RORLRMRN((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytversions"cCs|jddƒ|dk	r;t|tƒr;tdƒ‚nt|jj|jt	|ƒfƒ}|dkr}t
|dƒ‚ndS(sŽ
        Configure the cluster handle using a Ceph config file.

        :param path: path to the config file
        :type path: str
        Rlt	connectedspath must be a stringiserror calling conf_read_fileN(RiRYRtRuRvRfRntrados_conf_read_fileRrRR5(ROtpathR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRz!scCs·|jddƒ|sdStt|ƒ|Œ}tt|ƒƒ}t|jj|jt|ƒ||fƒ}|r…t|dƒ‚ng|D]}|dk	rŒ|^qŒ}||_	|S(sw
        Parse known arguments from args, and remove; returned
        args contain only those unknown to ceph
        RlRŒNs'error calling conf_parse_argv_remainder(
RiRtlenRfRntrados_conf_parse_argv_remainderRrR5RYRo(RORStcargstcretargsR2tatretargs((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytconf_parse_argv0s%	t	CEPH_ARGScCs`|jddƒ|sdSt|jj|jt|ƒfƒ}|dkr\t|dƒ‚ndS(sa
        Parse known arguments from an environment variable, normally
        CEPH_ARGS.
        RlRŒNiserror calling conf_parse_env(RiRfRntrados_conf_parse_envRrRR5(ROtvarR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytconf_parse_envHscCsÔ|jddƒt|tƒs.tdƒ‚nd}x™trÏt|ƒ}t|jj|j	t
|ƒ|t|ƒfƒ}|dkrŒ|jS|t
jkr©|d}q7|t
jkr½dSt|dƒ‚q7WdS(	sÙ
        Get the value of a configuration option

        :param option: which option to read
        :type option: str

        :returns: str - value of the option or None
        :raises: :class:`TypeError`
        RlRŒsoption must be a stringiiiserror calling conf_getN(RiRtRuRvR[RRfRntrados_conf_getRrRRRR&tENAMETOOLONGR(RYR5(ROtoptiontlengthtret_bufR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytconf_getUs 
	
cCs›|jddƒt|tƒs.tdƒ‚nt|tƒsLtdƒ‚nt|jj|jt|ƒt|ƒfƒ}|dkr—t	|dƒ‚ndS(s
        Set the value of a configuration option

        :param option: which option to set
        :type option: str
        :param option: value of the option
        :type option: str

        :raises: :class:`TypeError`, :class:`ObjectNotFound`
        RlRŒsoption must be a stringsval must be a stringiserror calling conf_setN(
RiRtRuRvRfRntrados_conf_setRrRR5(RORœtvalR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRyqs!cCsµ|jddƒtttƒƒƒ}tƒ}t|jj|jt|ƒ|t	|ƒfƒ}|j
|j }|jr“t|jj|j
fƒn|dkr±t
|dƒ‚n|S(sb
      Ping a monitor to assess liveness

      May be used as a simply way to assess liveness, or to obtain
      information about the monitor in a simple way even in the
      absence of quorum.

      :param mon_id: the ID portion of the monitor's name (i.e., mon.<ID>)
      :type mon_id: str
      :returns: the string reply from the monitor
      RlRŒiserror calling ping_monitor(RiR
RRRfRntrados_ping_monitorRrRR	tcontentsRtrados_buffer_freeR5(ROtmon_idtoutstrpt	outstrlenR2t	my_outstr((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytping_monitor‡s
		cCsV|jdƒt|jj|jf|ƒ}|dkrIt|dƒ‚nd|_dS(sO
        Connect to the cluster.  Use shutdown() to release resources.
        Rliserror connecting to the clusterRŒN(RiRfRnt
rados_connectRrR5Rh(RORbR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR…¥s
	cCs~tƒ}t|jj|jt|ƒfƒ}|dkrRt|d|jƒ‚ni|jd6|j	d6|j
d6|jd6S(sö
        Read usage info about the cluster

        This tells you total space, space used, space available, and number
        of objects. These are not updated immediately when data is written,
        they are eventually consistent.

        :returns: dict - contains the following keys:

            - ``kb`` (int) - total space

            - ``kb_used`` (int) - space used

            - ``kb_avail`` (int) - free space available

            - ``num_objects`` (int) - number of objects

        is-Rados.get_cluster_stats(%s): get_stats failedRERFRGR9(RDRfRntrados_cluster_statRrR	R5RsRERFRGR9(ROtstatsR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytget_cluster_stats°s	


cCsŠ|jdƒt|tƒs+tdƒ‚nt|jj|jt|ƒfƒ}|dkr_t	S|t
jkrstSt
|d|ƒ‚dS(sú
        Checks if a given pool exists.

        :param pool_name: name of the pool to check
        :type pool_name: str

        :raises: :class:`TypeError`, :class:`Error`
        :returns: bool - whether the pool exists, false otherwise.
        RŒspool_name must be a stringiserror looking up pool '%s'N(RiRtRuRvRfRntrados_pool_lookupRrRR[R&R(RZR5(ROt	pool_nameR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytpool_existsÎs

cCs|jdƒt|tƒs+tdƒ‚nt|jj|jt|ƒfƒ}|dkret	|ƒS|t
jkrydSt
|d|ƒ‚dS(sþ
        Returns a pool's ID based on its name.

        :param pool_name: name of the pool to look up
        :type pool_name: str

        :raises: :class:`TypeError`, :class:`Error`
        :returns: int - pool ID, or None if it doesn't exist
        RŒspool_name must be a stringiserror looking up pool '%s'N(RiRtRuRvRfRnR®RrRtintR&R(RYR5(ROR¯R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytpool_lookupäs


cCsã|jdƒt|tƒs+tdƒ‚ntdƒ}x¥trÞt|jƒ}t|j	j
|jt|ƒt
|ƒ|fƒ}||jkrt|ƒ}q:|tjkr±dS|dkrÓt|d|ƒ‚q:|jSPq:WdS(sý
        Returns a pool's name based on its ID.

        :param pool_id: ID of the pool to look up
        :type pool_id: int

        :raises: :class:`TypeError`, :class:`Error`
        :returns: string - pool name, or None if it doesn't exist
        RŒspool_id must be an integeriis"error reverse looking up pool '%s'N(RiRtR±RvRR[RRRfRntrados_pool_reverse_lookupRrRR	R&R(RYR5(ROtpool_idtsizetc_nameR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytpool_reverse_lookupús 

	$cCs]|jdƒt|tƒs+tdƒ‚n|dk	rVt|tƒrVtdƒ‚n|dkrÅ|dkr•t|jj|jt	|ƒfƒ}q7t|jj
|jt	|ƒt|ƒfƒ}nr|dkrt|jj|jt	|ƒt
|ƒfƒ}n6t|jj|jt	|ƒt
|ƒt|ƒfƒ}|dkrYt|d|ƒ‚ndS(su
        Create a pool:
        - with default settings: if auid=None and crush_rule=None
        - owned by a specific auid: auid given and crush_rule=None
        - with a specific CRUSH rule: if auid=None and crush_rule given
        - with a specific CRUSH rule and auid: if auid and crush_rule given

        :param pool_name: name of the pool to create
        :type pool_name: str
        :param auid: the id of the owner of the new pool
        :type auid: int
        :param crush_rule: rule to use for placement in the new pool
        :type crush_rule: str

        :raises: :class:`TypeError`, :class:`Error`
        RŒspool_name must be a stringscruse_rule must be a stringiserror creating pool '%s'N(RiRtRuRvRYRfRntrados_pool_createRrRt!rados_pool_create_with_crush_ruleRtrados_pool_create_with_auidRtrados_pool_create_with_allR5(ROR¯tauidt
crush_ruleR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytcreate_pools*
cCs|jdƒt|tƒs+tdƒ‚ntdƒ}t|jj|jt|ƒt	|ƒfƒ}|dkr†t
|d|ƒ‚n|jS(sr
        Get base pool

        :returns: base pool, or pool_id if tiering is not configured for the pool
        RŒspool_id must be an intisget_pool_base_tier(%d)(RiRtR±RvRRfRntrados_pool_get_base_tierRrR	R5R(ROR´t	base_tierR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytget_pool_base_tierAs
!cCsu|jdƒt|tƒs+tdƒ‚nt|jj|jt|ƒfƒ}|dkrqt	|d|ƒ‚ndS(s4
        Delete a pool and all data inside it.

        The pool is removed from the cluster immediately,
        but the actual data is deleted in the background.

        :param pool_name: name of the pool to delete
        :type pool_name: str

        :raises: :class:`TypeError`, :class:`Error`
        RŒspool_name must be a stringiserror deleting pool '%s'N(
RiRtRuRvRfRntrados_pool_deleteRrRR5(ROR¯R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytdelete_poolQs
cCs—|jdƒtdƒ}x_trzt|jƒ}t|jj|jt	|ƒ|fƒ}||jkrvt|ƒ}qPqWt
d„|jjdƒƒS(sU
        Gets a list of pool names.

        :returns: list - of pool names.
        RŒicSs
|dkS(NRm((R{((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt<lambda>ust(
RiRR[RRRfRntrados_pool_listRrR	tfiltertrawtsplit(RORµtc_namesR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
list_poolses
	cCsq|jdƒd}t|ƒ}t|jj|jt|ƒt|ƒfƒ}|dkrjt|dƒ‚n|j	S(sŒ
        Get the fsid of the cluster as a hexadecimal string.

        :raises: :class:`Error`
        :returns: str - cluster fsid
        RŒi%iserror getting cluster fsid(
RiRRfRntrados_cluster_fsidRrR	RR5R(ROtbuf_lentfsidR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytget_fsidws
!cCs–|jdƒt|tƒs+tdƒ‚ntƒ}t|jj|jt	|ƒt
|ƒfƒ}|dkrƒt|d|ƒ‚nt||j|ƒS(s.
        Create an io context

        The io context allows you to perform operations within a particular
        pool.

        :param ioctx_name: name of the pool
        :type ioctx_name: str

        :raises: :class:`TypeError`, :class:`Error`
        :returns: Ioctx - Rados Ioctx object
        RŒs%the name of the pool must be a stringiserror opening pool '%s'(
RiRtRuRvRRfRntrados_ioctx_createRrRR	R5tIoctx(ROt
ioctx_nametioctxR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
open_ioctx‡s

	!c

Cs|jdƒtttƒƒƒ}tƒ}tttƒƒƒ}tƒ}tt|ƒ|Œ}	|rÅt|jj|j	t|ƒ|	t|ƒt|ƒt|ƒ|t
|ƒ|t
|ƒf
|ƒ}
nTt|jj|j	|	t|ƒt|ƒt|ƒ|t
|ƒ|t
|ƒf	|ƒ}
|j|j
 }|j|j
 }|j
r^t|jj|jfƒn|j
rƒt|jj|jfƒn|
||fS(sŠ
        mon_command[_target](cmd, inbuf, outbuf, outbuflen, outs, outslen)
        returns (int ret, string outbuf, string outs)
        RŒ(RiR
RRRRRfRntrados_mon_command_targetRrR	trados_mon_commandR£RR¤(
ROtcmdtinbufRbRTtoutbufpt	outbuflentoutsptoutslentcmdarrR2t	my_outbuftmy_outs((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytmon_commandžs0
					c

Cs-|jdƒtttƒƒƒ}tƒ}tttƒƒƒ}tƒ}tt|ƒ|Œ}	t|jj|j	||	t|ƒt|ƒt|ƒ|t
|ƒ|t
|ƒf
|ƒ}
|j|j }|j|j }|jrût|jj
|jfƒn|jr t|jj
|jfƒn|
||fS(sˆ
        osd_command(osdid, cmd, inbuf, outbuf, outbuflen, outs, outslen)
        returns (int ret, string outbuf, string outs)
        RŒ(RiR
RRRRRfRntrados_osd_commandRrR	R£RR¤(
ROtosdidR×RØRbRÙRÚRÛRÜRÝR2RÞRß((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytosd_commandÃs$
					c

Cs3|jdƒtttƒƒƒ}tƒ}tttƒƒƒ}tƒ}tt|ƒ|Œ}	t|jj|j	t|ƒ|	t|ƒt|ƒt|ƒ|t
|ƒ|t
|ƒf
|ƒ}
|j|j }|j|j }|jrt|jj
|jfƒn|jr&t|jj
|jfƒn|
||fS(s†
        pg_command(pgid, cmd, inbuf, outbuf, outbuflen, outs, outslen)
        returns (int ret, string outbuf, string outs)
        RŒ(RiR
RRRRRfRntrados_pg_commandRrR	R£RR¤(
ROtpgidR×RØRbRÙRÚRÛRÜRÝR2RÞRß((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
pg_commandàs$
					cCs&|jdƒt|jj|jfƒS(NRŒ(RiRfRntrados_wait_for_latest_osdmapRr(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytwait_for_latest_osdmapýs
cCs`|jdƒt|jj|jt|ƒt|ƒfƒ}|dkr\t|d|ƒ‚ndS(s
        Blacklist a client from the OSDs

        :param client_address: client address
        :type client_address: str
        :param expire_seconds: number of seconds to blacklist
        :type expire_seconds: int

        :raises: :class:`Error`
        RŒiserror blacklisting client '%s'N(RiRfRntrados_blacklist_addRrRRR5(ROtclient_addresstexpire_secondsR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
blacklist_adds
N( RRRRiRYRPR‚R†R‰R‹RzR•R™RŸRyR©R…R­R°R²R·R¾RÁRÃRËRÏRÔRàRãRæRèRì(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRgÅs<		/						
							+					%	tObjectIteratorcBs2eZdZd„Zd„Zd„Zd„ZRS(srados.Ioctx Object iteratorcCsn||_tƒ|_t|jjj|jjt|jƒfƒ}|dkrjt|d|jj	ƒ‚ndS(Nis.error iterating over the objects in ioctx '%s'(
RÓRtctxRfRntrados_nobjects_list_opentioR	R5R{(RORÓR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRPs		cCs|S(N((RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__iter__scCs‹tƒ}tƒ}tƒ}t|jjj|jt|ƒt|ƒt|ƒfƒ}|dkrltƒ‚nt|j|j	|j	|j	ƒS(sŒ
        Get the next object name and locator in the pool

        :raises: StopIteration
        :returns: next rados.Ioctx Object
        i(
RRfRÓRntrados_nobjects_list_nextRîR	t
StopIterationtObjectR(ROR€tlocatortnspaceR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytnext!s			*cCs t|jjj|jfƒdS(N(RfRÓRntrados_nobjects_list_closeRî(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__del__1s(RRRRPRñR÷Rù(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRís
				t
XattrIteratorcBs2eZdZd„Zd„Zd„Zd„ZRS(sExtended attribute iteratorcCs||_||_||_dS(N(RÓtittoid(RORÓRûRü((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRP6s		cCs|S(N((RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRñ;scCsÈtdƒ}tdƒ}tdƒ}t|jjj|jt|ƒt|ƒt|ƒfƒ}|dkr‚t|d|j	ƒ‚n|j
dkrtƒ‚nt
j|ƒ}t
j||ƒ}||fS(s
        Get the next xattr on the object

        :raises: StopIteration
        :returns: pair - of name and value of the next Xattr
        is4error iterating over the extended attributes in '%s'N(RRRfRÓRntrados_getxattrs_nextRûR	R5RüRRYRótctypest	string_at(ROtname_tval_tlen_R2R{R¡((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR÷>s*cCs t|jjj|jfƒdS(N(RfRÓRntrados_getxattrs_endRû(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRùSs(RRRRPRñR÷Rù(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRú4s
			tSnapIteratorcBs)eZdZd„Zd„Zd„ZRS(sSnapshot iteratorcCs»||_d}xœtr­tj|ƒ|_t|jjj|jj|jt	|ƒfƒ}|dkrt||_
Pn,|tjkr t
|d|jjƒ‚n|d}qWd|_dS(Ni
is,error calling rados_snap_list for ioctx '%s'i(RÓR[RþRtsnapsRfRntrados_ioctx_snap_listRðRtmax_snapR&tERANGER5R{tcur_snap(RORÓt	num_snapsR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRPXs		!	cCs|S(N((RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRñjscCsô|j|jkrt‚n|j|j}d}x”trÇt|ƒ}t|jjj	|jj
t|ƒt|ƒt
|ƒfƒ}|dkr˜|}Pn"|tjkrºt|dƒ‚n|d}q4Wt|j|j|ƒ}|jd|_|S(s~
        Get the next Snapshot

        :raises: :class:`Error`, StopIteration
        :returns: Snap - next snapshot
        i
isrados_snap_get_name errorii(R	RRóRR[RRfRÓRntrados_ioctx_snap_get_nameRðRR	RR&RR5tSnapR(ROtsnap_idtname_lenR{R2tsnap((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR÷ms$		(RRRRPRñR÷(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRVs		RcBs)eZdZd„Zd„Zd„ZRS(sSnapshot objectcCs||_||_||_dS(N(RÓR{R
(RORÓR{R
((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRP‰s		cCs dt|jƒ|j|jfS(Ns'rados.Snap(ioctx=%s,name=%s,snap_id=%d)(RuRÓR{R
(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRQŽscCsjtdƒ}t|jjj|jj|jt|ƒfƒ}|dkrZt|dƒ‚nt	j
|jƒS(s¬
        Find when a snapshot in the current pool occurred

        :raises: :class:`Error`
        :returns: datetime - the data and time the snapshot was created
        is rados_ioctx_snap_get_stamp error(RRfRÓRntrados_ioctx_snap_get_stampRðR
R	R5Rt
fromtimestampR(ROt	snap_timeR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
get_timestamp’s!(RRRRPRQR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR‡s		t
CompletioncBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
scompletion objectcCs:||_||_||_||_||_||_dS(N(t
rados_compt
oncompletetonsafeRÓtcomplete_cbtsafe_cb(RORÓRRRRR((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRP¢s					cCs"t|jjj|jfƒdkS(s§
        Is an asynchronous operation safe?

        This does not imply that the safe callback has finished.

        :returns: True if the operation is safe
        i(RfRÓRntrados_aio_is_safeR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytis_safe«scCs"t|jjj|jfƒdkS(s²
        Has an asynchronous operation completed?

        This does not imply that the safe callback has finished.

        :returns: True if the operation is completed
        i(RfRÓRntrados_aio_is_completeR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytis_complete¶scCs t|jjj|jfƒdS(sˆ
        Wait for an asynchronous operation to be marked safe

        This does not imply that the safe callback has finished.
        N(RfRÓRntrados_aio_wait_for_safeR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
wait_for_safeÁscCs t|jjj|jfƒdS(s†
        Wait for an asynchronous operation to complete

        This does not imply that the complete callback has finished.
        N(RfRÓRntrados_aio_wait_for_completeR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytwait_for_completeÊscCs t|jjj|jfƒdS(sy
        Wait for an asynchronous operation to be marked safe and for
        the safe callback to have returned
        N(RfRÓRntrados_aio_wait_for_safe_and_cbR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytwait_for_safe_and_cbÓscCst|jjj|jfƒS(s®
        Wait for an asynchronous operation to complete and for the
        complete callback to have returned

        :returns:  whether the operation is completed
        (RfRÓRnt"rados_aio_wait_for_complete_and_cbR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytwait_for_complete_and_cbÛscCst|jjj|jfƒS(sá
        Get the return value of an asychronous operation

        The return value is set when the operation is complete or safe,
        whichever comes first.

        :returns: int - return value of the operation
        (RfRÓRntrados_aio_get_return_valueR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytget_return_valueçs	cCs t|jjj|jfƒdS(s¶
        Release a completion

        Call this when you no longer need the completion. It may not be
        freed immediately if the operation is not acked and committed.
        N(RfRÓRntrados_aio_releaseR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRùós(RRRRPRRRR!R#R%R'Rù(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR s											RÑcBsµeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	dd-d-d	„Zd-d-d
„Zd-d-d„Z
d„Zd
„Zd-d-d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zddd„Zd„Zd„Zd„Zd„Zd„Z d „Z!d!„Z"d"„Z#d#„Z$d$„Z%d%„Z&d&„Z'd'„Z(d(„Z)d)d-dd*„Z*d)d-dd+„Z+d,„Z,RS(.srados.Ioctx objectcCs[||_||_||_d|_d|_d|_i|_i|_tj	ƒ|_
dS(NtopenRm(R{RnRðRhtlocator_keyRötsafe_cbstcomplete_cbsRUtLocktlock(ROR{RnRð((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRPs								cCs|S(N((RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR†scCs|jƒtS(N(tcloseRZ(ROR‡RRˆ((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR‰s
cCs|jƒdS(N(R/(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRùscCs>d}|j|j|}|j|=WdQX|j|ƒdS(sB
        Callback to onsafe() for asynchronous operations
        Ni(RYR.R+R(ROt
completiont_tcb((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
__aio_safe_cbs


cCs>d}|j|j|}|j|=WdQX|j|ƒdS(sF
        Callback to oncomplete() for asynchronous operations
        Ni(RYR.R,R(ROR0R1R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__aio_complete_cb!s


cCsôtdƒ}d}d}|r0t|jƒ}n|rHt|jƒ}nt|jjtdƒ||t|ƒfƒ}|dkr“t	|dƒ‚n|j
Rt||||||ƒ}|rÑ||j|j
<n|rê||j|j
<nWdQX|S(s·
        Constructs a completion to use with asynchronous operations

        :param oncomplete: what to do when the write is safe and complete in memory
            on all replicas
        :type oncomplete: completion
        :param onsafe:  what to do when the write is safe and complete on storage
            on all replicas
        :type onsafe: completion

        :raises: :class:`Error`
        :returns: completion object
        iserror getting a completionN(RRYtRADOS_CBt_Ioctx__aio_complete_cbt_Ioctx__aio_safe_cbRfRntrados_aio_create_completionR	R5R.RR,RR+(RORRR0RRR2tcompletion_obj((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt__get_completion,s(
ic	Csƒ|j||ƒ}t|jj|jt|ƒ|jt|ƒtt|ƒƒt	|ƒfƒ}|dkrt
|d|ƒ‚n|S(s¹
        Write data to an object asynchronously

        Queues the write and returns.

        :param object_name: name of the object
        :type object_name: str
        :param to_write: data to write
        :type to_write: str
        :param offset: byte offset in the object to begin writing at
        :type offset: int
        :param oncomplete: what to do when the write is safe and complete in memory
            on all replicas
        :type oncomplete: completion
        :param onsafe:  what to do when the write is safe and complete on storage
            on all replicas
        :type onsafe: completion

        :raises: :class:`Error`
        :returns: completion object
        iserror writing object %s(t_Ioctx__get_completionRfRntrados_aio_writeRðRRRRRR5(ROtobject_nametto_writetoffsetRRR0R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt	aio_writeOs!c	Csz|j||ƒ}t|jj|jt|ƒ|jt|ƒtt|ƒƒfƒ}|dkrvt	|d|ƒ‚n|S(sØ
        Asychronously write an entire object

        The object is filled with the provided data. If the object exists,
        it is atomically truncated and then written.
        Queues the write and returns.

        :param object_name: name of the object
        :type object_name: str
        :param to_write: data to write
        :type to_write: str
        :param oncomplete: what to do when the write is safe and complete in memory
            on all replicas
        :type oncomplete: completion
        :param onsafe:  what to do when the write is safe and complete on storage
            on all replicas
        :type onsafe: completion

        :raises: :class:`Error`
        :returns: completion object
        iserror writing object %s(
R;RfRntrados_aio_write_fullRðRRRRR5(ROR=R>RRR0R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytaio_write_fullosc	Csz|j||ƒ}t|jj|jt|ƒ|jt|ƒtt|ƒƒfƒ}|dkrvt	|d|ƒ‚n|S(s¼
        Asychronously append data to an object

        Queues the write and returns.

        :param object_name: name of the object
        :type object_name: str
        :param to_append: data to append
        :type to_append: str
        :param offset: byte offset in the object to begin writing at
        :type offset: int
        :param oncomplete: what to do when the write is safe and complete in memory
            on all replicas
        :type oncomplete: completion
        :param onsafe:  what to do when the write is safe and complete on storage
            on all replicas
        :type onsafe: completion

        :raises: :class:`Error`
        :returns: completion object
        iserror appending to object %s(
R;RfRntrados_aio_appendRðRRRRR5(ROR=t	to_appendRRR0R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
aio_appendscCs=t|jj|jfƒ}|dkr9t|dƒ‚ndS(sk
        Block until all pending writes in an io context are safe

        :raises: :class:`Error`
        iserror flushingN(RfRntrados_aio_flushRðR5(ROR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt	aio_flush®sc	s•t|ƒ‰‡‡fd†}|j|dƒ}t|jj|jt|ƒ|jˆt	|ƒt
|ƒfƒ}|dkr‘t|d|ƒ‚n|S(sz
        Asychronously read data from an object

        oncomplete will be called with the returned read value as
        well as the completion:

        oncomplete(completion, data_read)

        :param object_name: name of the object to read from
        :type object_name: str
        :param length: the number of bytes to read
        :type length: int
        :param offset: byte offset in the object to begin reading from
        :type offset: int
        :param oncomplete: what to do when the read is complete
        :type oncomplete: completion

        :raises: :class:`Error`
        :returns: completion object
        cs7|jƒ}ˆ||dkr0tjˆ|ƒndƒS(Ni(R'RþRÿRY(tcompletion_vtreturn_value(tbufR(s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytoncomplete_Îsiserror reading %sN(RR;RYRfRntrados_aio_readRðRRRRR5(ROR=RR?RRKR0R2((RJRs:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytaio_read¸scCsb|j||ƒ}t|jj|jt|ƒ|jfƒ}|dkr^t|d|ƒ‚n|S(sô
        Asychronously remove an object

        :param object_name: name of the object to remove
        :type object_name: str
        :param oncomplete: what to do when the remove is safe and complete in memory
            on all replicas
        :type oncomplete: completion
        :param onsafe:  what to do when the remove is safe and complete on storage
            on all replicas
        :type onsafe: completion

        :raises: :class:`Error`
        :returns: completion object
        iserror removing %s(R;RfRntrados_aio_removeRðRRR5(ROR=RRR0R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
aio_removeÜscCs)|jdkr%td|jƒ‚ndS(sd
        Checks if the rados.Ioctx object state is 'open'

        :raises: IoctxStateError
        R)sThe pool is %sN(RhR"(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytrequire_ioctx_openôscCs`|jƒt|jj|jtj|ƒfƒ}|dkr\t|d|j|fƒ‚ndS(sÈ
        Attempt to change an io context's associated auid "owner."

        Requires that you have write permission on both the current and new
        auid.

        :raises: :class:`Error`
        is!error changing auid of '%s' to %dN(	RPRfRntrados_ioctx_pool_set_auidRðRþRR5R{(ROR¼R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytchange_auidýs	
	cCsW|jƒt|tƒs(tdƒ‚nt|jj|jt|ƒfƒ||_	dS(s'
        Set the key for mapping objects to pgs within an io context.

        The key is used instead of the object name to determine which
        placement groups an object is put in. This affects all subsequent
        operations of the io context - until a different locator key is
        set, all objects in this io context will be placed in the same pg.

        :param loc_key: the key to use as the object locator, or NULL to discard
            any previously set key
        :type loc_key: str

        :raises: :class:`TypeError`
        sloc_key must be a stringN(
RPRtRuRvRfRntrados_ioctx_locator_set_keyRðRR*(ROtloc_key((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytset_locator_key
s
cCs|jS(sO
        Get the locator_key of context

        :returns: locator_key
        (R*(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytget_locator_key#scCsl|jƒ|dkrd}nt|tƒs=tdƒ‚nt|jj|jt	|ƒfƒ||_
dS(så
        Set the namespace for objects within an io context.

        The namespace in addition to the object name fully identifies
        an object. This affects all subsequent operations of the io context
        - until a different namespace is set, all objects in this io context
        will be placed in the same namespace.

        :param nspace: the namespace to use, or None/"" for the default namespace
        :type nspace: str

        :raises: :class:`TypeError`
        Rmsnamespace must be a stringN(RPRYRtRuRvRfRntrados_ioctx_set_namespaceRðRRö(RORö((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
set_namespace+s
	cCs|jS(sK
        Get the namespace of context

        :returns: namespace
        (Rö(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
get_namespaceBscCsB|jdkr>|jƒt|jj|jfƒd|_ndS(s6
        Close a rados.Ioctx object.

        This just tells librados that you no longer need to use the io context.
        It may not be freed immediately if there are pending asynchronous
        requests on it, but you should not use an io context again after
        calling this function on it.
        R)tclosedN(RhRPRfRntrados_ioctx_destroyRð(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR/Js	
cCsé|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|ƒ}t|jj|jt	|ƒt	|ƒt
|ƒt|ƒfƒ}|dkr¡|S|dkrÌt|d|j
|fƒ‚ntd|j
|fƒ‚dS(s
        Write data to an object synchronously

        :param key: name of the object
        :type key: str
        :param data: data to write
        :type data: str
        :param offset: byte offset in the object to begin writing at
        :type offset: int

        :raises: :class:`TypeError`
        :raises: :class:`LogicError`
        :returns: int - 0 on success
        skey must be a stringsdata must be a stringis#Ioctx.write(%s): failed to write %ssLIoctx.write(%s): rados_write returned %d, but should return zero on success.N(RPRtRuRvRRfRntrados_writeRðRRRR5R{R$(ROR€tdataR?RR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytwriteXs 
	cCsà|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|ƒ}t|jj|jt	|ƒt	|ƒt
|ƒfƒ}|dkr˜|S|dkrÃt|d|j|fƒ‚nt
d|j|fƒ‚dS(sœ
        Write an entire object synchronously.

        The object is filled with the provided data. If the object exists,
        it is atomically truncated and then written.

        :param key: name of the object
        :type key: str
        :param data: data to write
        :type data: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: int - 0 on success
        skey must be a stringsdata must be a stringis(Ioctx.write_full(%s): failed to write %ssVIoctx.write_full(%s): rados_write_full returned %d, but should return zero on success.N(RPRtRuRvRRfRntrados_write_fullRðRRR5R{R$(ROR€R]RR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
write_fullys 
	cCsà|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|ƒ}t|jj|jt	|ƒt	|ƒt
|ƒfƒ}|dkr˜|S|dkrÃt|d|j|fƒ‚nt
d|j|fƒ‚dS(s!
        Append data to an object synchronously

        :param key: name of the object
        :type key: str
        :param data: data to write
        :type data: str

        :raises: :class:`TypeError`
        :raises: :class:`LogicError`
        :returns: int - 0 on success
        skey must be a stringsdata must be a stringis%Ioctx.append(%s): failed to append %ssNIoctx.append(%s): rados_append returned %d, but should return zero on success.N(RPRtRuRvRRfRntrados_appendRðRRR5R{R$(ROR€R]RR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytappend›s 
	i cCs¨|jƒt|tƒs(tdƒ‚nt|ƒ}t|jj|jt	|ƒ|t
|ƒt|ƒfƒ}|dkr˜t|d|j
|fƒ‚ntj||ƒS(s¥
        Read data from an object synchronously

        :param key: name of the object
        :type key: str
        :param length: the number of bytes to read (default=8192)
        :type length: int
        :param offset: byte offset in the object to begin reading at
        :type offset: int

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: str - data read from object
        skey must be a stringis!Ioctx.read(%s): failed to read %s(RPRtRuRvRRfRnt
rados_readRðRRRR5R{RþRÿ(ROR€RR?RžR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytreadºs
cCsØ|jƒtƒ}t|jj|jt|ƒfƒ}|dkr\t|d|jƒ‚ni|j	d6|j
d6|jd6|jd6|j
d6|jd6|jd	6|jd
6|jd6|jd6|jd
6|jd6S(si
        Get pool usage statistics

        :returns: dict - contains the following keys:

            - ``num_bytes`` (int) - size of pool in bytes

            - ``num_kb`` (int) - size of pool in kbytes

            - ``num_objects`` (int) - number of objects in the pool

            - ``num_object_clones`` (int) - number of object clones

            - ``num_object_copies`` (int) - number of object copies

            - ``num_objects_missing_on_primary`` (int) - number of objets
                missing on primary

            - ``num_objects_unfound`` (int) - number of unfound objects

            - ``num_objects_degraded`` (int) - number of degraded objects

            - ``num_rd`` (int) - bytes read

            - ``num_rd_kb`` (int) - kbytes read

            - ``num_wr`` (int) - bytes written

            - ``num_wr_kb`` (int) - kbytes written
        is%Ioctx.get_stats(%s): get_stats failedR7R8R9R:R;R<R=R>R?R@RARB(RPR6RfRntrados_ioctx_pool_statRðR	R5R{R7R8R9R:R;R<R=R>R?R@RARB(ROR¬R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt	get_statsÔs$
	










cCsr|jƒt|tƒs(tdƒ‚nt|jj|jt|ƒfƒ}|dkrnt	|d|ƒ‚nt
S(s
        Delete an object

        This does not delete any snapshots of the object.

        :param key: the name of the object to delete
        :type key: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: bool - True on success
        skey must be a stringisFailed to remove '%s'(RPRtRuRvRfRntrados_removeRðRR5R[(ROR€R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
remove_objects
cCs„|jƒt|tƒs(tdƒ‚nt|jj|jt|ƒt	|ƒfƒ}|dkr€t
|d|j|fƒ‚n|S(sÖ
        Resize an object

        If this enlarges the object, the new area is logically filled with
        zeroes. If this shrinks the object, the excess data is removed.

        :param key: the name of the object to resize
        :type key: str
        :param size: the new size of the object in bytes
        :type size: int

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: int - 0 on success, otherwise raises error
        skey must be a stringis&Ioctx.trunc(%s): failed to truncate %s(RPRtRuRvRfRntrados_truncRðRRR5R{(ROR€RµR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyttruncs
!cCs«|jƒt|tƒs(tdƒ‚ntƒ}tƒ}t|jj|jt	|ƒt
|ƒt
|ƒfƒ}|dkr’t|d|ƒ‚n|jt
j|jƒfS(sì
        Get object stats (size/mtime)

        :param key: the name of the object to get stats from
        :type key: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: (size,timestamp)
        skey must be a stringisFailed to stat %r(RPRtRuRvRRfRnt
rados_statRðRR
R5Rttimet	localtime(ROR€tpsizetpmtimeR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytstat6s
		cCsÖ|jƒt|tƒs(tdƒ‚nd}x•|dkrÅt|ƒ}t|jj|jt	|ƒt	|ƒ|t
|ƒfƒ}|tjkrŸ|d9}q1|dkrÁt
|d|ƒ‚q1Pq1Wtj||ƒS(	se
        Get the value of an extended attribute on an object.

        :param key: the name of the object to get xattr from
        :type key: str
        :param xattr_name: which extended attribute to read
        :type xattr_name: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: str - value of the xattr
        sxattr_name must be a stringiiiisFailed to get xattr %ri@I(RPRtRuRvRRfRntrados_getxattrRðRRR&RR5RþRÿ(ROR€t
xattr_namet
ret_lengthRžR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt	get_xattrNs

cCs|jƒt|tƒs(tdƒ‚ntdƒ}t|jj|j|t	|ƒfƒ}|dkr}t
|d|ƒ‚nt|||ƒS(sö
        Start iterating over xattrs on an object.

        :param oid: the name of the object to get xattrs from
        :type key: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: XattrIterator
        soid must be a stringis(Failed to get rados xattrs for object %r(RPRtRuRvRRfRntrados_getxattrsRðR	R5Rú(RORüRûR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
get_xattrsls
c	CsÏ|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|tƒsdtdƒ‚nt|jj|jt|ƒt|ƒt|ƒt	t
|ƒƒfƒ}|dkrËt|d|ƒ‚ntS(sÍ
        Set an extended attribute on an object.

        :param key: the name of the object to set xattr to
        :type key: str
        :param xattr_name: which extended attribute to set
        :type xattr_name: str
        :param xattr_value: the value of the  extended attribute
        :type xattr_value: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: bool - True on success, otherwise raise an error
        skey must be a stringsxattr_name must be a stringsxattr_value must be a stringisFailed to set xattr %r(
RPRtRuRvRfRntrados_setxattrRðRRRR5R[(ROR€Rrtxattr_valueR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt	set_xattrs
!cCsŸ|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|jj|jt|ƒt|ƒfƒ}|dkr›t	|d||fƒ‚nt
S(s~
        Removes an extended attribute on from an object.

        :param key: the name of the object to remove xattr from
        :type key: str
        :param xattr_name: which extended attribute to remove
        :type xattr_name: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: bool - True on success, otherwise raise an error
        skey must be a stringsxattr_name must be a stringis Failed to delete key %r xattr %r(RPRtRuRvRfRnt
rados_rmxattrRðRR5R[(ROR€RrR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytrm_xattržs
!	cCs|jƒt|ƒS(s]
        Get ObjectIterator on rados.Ioctx object.

        :returns: ObjectIterator
        (RPRí(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytlist_objects·s
cCs|jƒt|ƒS(sY
        Get SnapIterator on rados.Ioctx object.

        :returns: SnapIterator
        (RPR(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt
list_snapsÀs
cCsr|jƒt|tƒs(tdƒ‚nt|jj|jt|ƒfƒ}|dkrnt	|d|ƒ‚ndS(sÃ
        Create a pool-wide snapshot

        :param snap_name: the name of the snapshot
        :type snap_name: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        ssnap_name must be a stringisFailed to create snap %sN(
RPRtRuRvRfRntrados_ioctx_snap_createRðRR5(ROt	snap_nameR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytcreate_snapÉs

cCsr|jƒt|tƒs(tdƒ‚nt|jj|jt|ƒfƒ}|dkrnt	|d|ƒ‚ndS(sÄ
        Removes a pool-wide snapshot

        :param snap_name: the name of the snapshot
        :type snap_name: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        ssnap_name must be a stringisFailed to remove snap %sN(
RPRtRuRvRfRntrados_ioctx_snap_removeRðRR5(RORR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytremove_snapÛs

cCs|jƒt|tƒs(tdƒ‚ntƒ}t|jj|jt	|ƒt
|ƒfƒ}|dkr€t|d|ƒ‚nt|||ƒS(só
        Get the id of a pool snapshot

        :param snap_name: the name of the snapshot to lookop
        :type snap_name: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        :returns: Snap - on success
        ssnap_name must be a stringisFailed to lookup snap %s(
RPRtRuRvRRfRntrados_ioctx_snap_lookupRðRR	R5R(RORR
R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytlookup_snapís
	!cCs#|jƒt|jj|jfƒS(sï
        Return the version of the last object read or written to.

        This exposes the internal version number of the last object read or
        written via this io context

        :returns: version of the last object used
        (RPRfRntrados_get_last_versionRð(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytget_last_versions	
RmcCsc|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|tƒsdtdƒ‚nt|tƒs‚tdƒ‚n|d	k	r­t|tƒr­tdƒ‚nt|tƒsËtdƒ‚nt|jj|j	t
|ƒt
|ƒt
|ƒt
|ƒ|d	krt|d	ƒnd	t|ƒfƒ}|dkr_t
|d|j||fƒ‚nd	S(
s

        Take an exclusive lock on an object

        :param key: name of the object
        :type key: str
        :param name: name of the lock
        :type name: str
        :param cookie: cookie of the lock
        :type cookie: str
        :param desc: description of the lock
        :type desc: str
        :param duration: duration of the lock in seconds
        :type duration: int
        :param flags: flags
        :type flags: int

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        skey must be a stringsname must be a stringscookie must be a stringsdesc must be a stringsduration must be a integersflags must be a integeris;Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %sN(RPRtRuRvRYR±RfRntrados_lock_exclusiveRðRRHRR5R{(ROR€R{tcookietdesctdurationR~R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytlock_exclusives(
!	c	CsŠ|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|tƒsdtdƒ‚nt|tƒs‚tdƒ‚nt|tƒs tdƒ‚n|d
k	rËt|tƒrËtdƒ‚nt|tƒsétdƒ‚nt|jj|j	t
|ƒt
|ƒt
|ƒt
|ƒt
|ƒ|d
krCt|d
ƒnd
t|ƒfƒ}|dkr†t
|d	|j||fƒ‚nd
S(sA
        Take a shared lock on an object

        :param key: name of the object
        :type key: str
        :param name: name of the lock
        :type name: str
        :param cookie: cookie of the lock
        :type cookie: str
        :param tag: tag of the lock
        :type tag: str
        :param desc: description of the lock
        :type desc: str
        :param duration: duration of the lock in seconds
        :type duration: int
        :param flags: flags
        :type flags: int

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        skey must be a stringsname must be a stringscookie must be a stringstag must be a stringsdesc must be a stringsduration must be a integersflags must be a integeris;Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %sN(RPRtRuRvRYR±RfRntrados_lock_sharedRðRRHRR5R{(	ROR€R{RˆttagR‰RŠR~R2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytlock_shared9s,
!cCsÌ|jƒt|tƒs(tdƒ‚nt|tƒsFtdƒ‚nt|tƒsdtdƒ‚nt|jj|jt|ƒt|ƒt|ƒfƒ}|dkrÈt	|d|j
||fƒ‚ndS(sG
        Release a shared or exclusive lock on an object

        :param key: name of the object
        :type key: str
        :param name: name of the lock
        :type name: str
        :param cookie: cookie of the lock
        :type cookie: str

        :raises: :class:`TypeError`
        :raises: :class:`Error`
        skey must be a stringsname must be a stringscookie must be a stringis;Ioctx.rados_lock_exclusive(%s): failed to set lock %s on %sN(RPRtRuRvRfRntrados_unlockRðRR5R{(ROR€R{RˆR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytunlockhs
*N(-RRRRPR†R‰RùR7R6R;RYR@RBRERGRMRORPRRRURVRXRYR/R^R`RbRdRfRhRjRpRtRvRyR{R|R}R€R‚R„R†R‹RŽR(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRÑÿsV							# 	
	$								!	"		2															+/cs‡fd†}|S(Ncsk|jdk	rW|jjƒ}|jj|jƒˆ|||Ž}|jj|ƒ|Sˆ|||ŽSdS(N(R*RYRÓRVRU(RORStkwargstold_locatorRW(tfunc(s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytretfunc‡s((R“R”((R“s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytset_object_locator†s	cs‡fd†}|S(Ncsf|jdkrtdƒ‚n|jjƒ}|jj|jƒˆ|||Ž}|jj|ƒ|S(Ns%Namespace not set properly in context(RöRYR$RÓRYRX(RORSR‘t
old_nspaceRW(R“(s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR”“s((R“R”((R“s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytset_object_namespace’sRôcBsãeZdZddd„Zd„Zd„Zeedd„ƒƒZ	eed„ƒƒZ
eed„ƒƒZeed„ƒƒZd	„Z
eed
„ƒƒZeed„ƒƒZeed„ƒƒZeed
„ƒƒZRS(s7Rados object wrapper, makes the object look like a filecCsL||_||_d|_d|_||_|dkr?dn||_dS(NitexistsRm(R€RÓR?RhR*RYRö(RORÓR€R*Rö((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRPŸs					cCs;dt|jƒ|j|jdkr*dn|j|jfS(Ns2rados.Object(ioctx=%s,key=%s,nspace=%s,locator=%s)Rms--default--(RuRÓR€RöR*(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRQ§scCs)|jdkr%td|jƒ‚ndS(NR˜sThe object is %s(RhR#(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytrequire_object_exists«sicCsA|jƒ|jj|j||jƒ}|jt|ƒ7_|S(N(R™RÓRdR€R?R(RORR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRd¯s
cCs;|jƒ|jj|j||jƒ}|j|7_|S(N(R™RÓR^R€R?(ROtstring_to_writeR2((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR^·s
cCs*|jƒ|jj|jƒd|_dS(Ntremoved(R™RÓRhR€Rh(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytremove¿s
cCs|jƒ|jj|jƒS(N(R™RÓRpR€(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRpÆs
cCs|jƒ||_dS(N(R™R?(ROtposition((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytseekÌs
cCs |jƒ|jj|j|ƒS(N(R™RÓRtR€(RORr((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRtÐs
cCs|jƒ|jj|jƒS(N(R™RÓRvR€(RO((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRvÖs
cCs#|jƒ|jj|j||ƒS(N(R™RÓRyR€(RORrRx((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRyÜs
cCs |jƒ|jj|j|ƒS(N(R™RÓR{R€(RORr((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR{âs
Ni(RRRRYRPRQR™R•R—RdR^RœRpRžRtRvRyR{(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRôs,			tdebugtinfotwarntwarningterrterrortsect
MonitorLogcBs eZdZd„Zd„ZRS(s¼
    For watching cluster log messages.  Instantiate an object and keep
    it around while callback is periodically called.  Construct with
    'level' to monitor 'level' messages (one of MONITOR_LEVELS).
    arg will be passed to the callback.

    callback will be called with:
        arg (given to __init__)
        line (the full line, including timestamp, who, level, msg)
        who (which entity issued the log message)
        timestamp_sec (sec of a struct timespec)
        timestamp_nsec (sec of a struct timespec)
        seq (sequence number)
        level (string representing the level of the log message)
        msg (the message itself)
    callback's return value is ignored
    c			Cs&|j||||||||ƒdS(sK
        Local callback wrapper, in case we decide to do something
        i(tcallback(	ROtargtlinetwhoR¥tnsectseqtlevelR3((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pytmonitor_log_callbacks"c
CsÎ|tkrtd|ƒ‚nt|ƒs:tdƒ‚n||_||_||_tttt	t	t
t
tt	t	ƒ	}||jƒ|_
t|jj|j||j
|fƒ}|rÊt|dƒ‚ndS(Nsinvalid monitor level s$callback must be a callable functionserror calling rados_monitor_log(tMONITOR_LEVELSR$tcallableR­R§R¨RRRRRRR®tinternal_callbackRfRntrados_monitor_logRrR5(RORrR­R§R¨tcallback_factorytr((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyRPs*				(RRRR®RP(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyR¦ñs	(IRRþRRRRRRRRRR	R
RRR
RRRRtctypes.utilRR&RURlRtANONYMOUS_AUIDt
ADMIN_AUIDtLIBRADOS_ALL_NSPACEStLIBRADOS_OP_FLAG_FADVISE_RANDOMt#LIBRADOS_OP_FLAG_FADVISE_SEQUENTIALt!LIBRADOS_OP_FLAG_FADVISE_WILLNEEDt!LIBRADOS_OP_FLAG_FADVISE_DONTNEEDt LIBRADOS_OP_FLAG_FADVISE_NOCACHEt	ExceptionRRRRRRRRRR R!R"R#R$R%R5R6RDRHtobjectRKRVRRR`RfRgRíRúRRRR5RÑR•R—RôR¯R¦(((s:/home/tvault/.virtenv/lib/python2.7/site-packages/rados.pyt<module>sxv	

#ÿÿP!"1]ÿÿÿŠ		L