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:
ó
±EYc@sÂdZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddl
m
ZddlZddlm
Z
ddlmZddlmZddlmZd	„Zd
ejfd„ƒYZejZejZdejfd
„ƒYZdejfd„ƒYZdefd„ƒYZ defd„ƒYZ!dej"fd„ƒYZ"dej#fd„ƒYZ$d„Z%d„Z&d„Z'd„Z(dd„Z*dS(s!Nova common internal object modeliÿÿÿÿN(tversionutils(tbase(t	exception(tobjects(tfields(tutilscCsd|S(s>Return the mangled name of the attribute's underlying storage.t_obj_((tname((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytget_attrname#stNovaObjectRegistrycBs5eZgZd„Zed„ƒZed„ƒZRS(cCsŠtj|jƒ}tt|jƒƒs@tt|jƒ|ƒnFtjtt|jƒƒjƒ}||kr†tt|jƒ|ƒndS(N(Rtconvert_version_to_tupletVERSIONthasattrRtobj_nametsetattrtgetattr(tselftclstindextversiontcur_version((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytregistration_hook-scCs'|jtƒ|ƒ|jj|ƒ|S(sµRegister a class as notification.
        Use only to register concrete notification or payload classes,
        do not register base classes intended for inheritance only.
        (tregister_iftFalsetnotification_classestappend(Rtnotification_cls((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytregister_notification:scCs%x|jD]}|j|ƒq
WdS(s²Register previously decorated notification as normal ovos.
        This is not intended for production use but only for testing and
        document generation purposes.
        N(Rtregister(RR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytregister_notification_objectsDs(t__name__t
__module__RRtclassmethodRR(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR	*s	

t
NovaObjectcBs\eZdZdZdZed„ƒZded„Z	e
jd„ƒZe
jd„ƒZ
RS(s\Base class and object factory.

    This forms the base of all objects that can be remoted or instantiated
    via RPC. Simply defining a class that inherits from this base class
    will make it remotely instantiatable. Objects should implement the
    necessary "get" classmethod routines as well as "save" object methods
    as appropriate.
    tnova_objecttnovacCs
tƒ‚dS(sÊA check that can be used to inhibit online migration behavior

        This is usually used to check if all services that will be accessing
        the db directly are ready for the new format.
        N(tNotImplementedError(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytshould_migrate_data`scCs|r×xÎ|jƒD]½}|r1||kr1qn|j|ƒsFqnt||ƒ}|dkrgqnt|j|tjƒr“|jdt	ƒqt|j|tj
ƒrx!|D]}|jdt	ƒq³WqqWn|rõ|jt|ƒ8_n
|jj
ƒdS(sReset the list of fields that have been changed.

        .. note::

          - This is NOT "revert to previous values"
          - Specifying fields on recursive resets will only be honored at the
            top level. Everything below the top will reset all.

        :param fields: List of fields to reset, or "all" if None.
        :param recursive: Call obj_reset_changes(recursive=True) on
                          any sub-objects within the list of fields
                          being reset.
        t	recursiveN(tobj_get_changestobj_attr_is_setRtNonet
isinstanceRt
obj_fieldstObjectFieldtobj_reset_changestTruetListOfObjectsFieldt_changed_fieldstsettclear(RRR&tfieldtvaluetthing((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR-ls$

ccs,|j}||_z	dVWd||_XdS(N(t_context(Rtcontexttoriginal_context((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytobj_alternate_context™s
			ccse|jdkr0tjddd|jƒƒ‚n|j}|jjƒ|_z	dVWd||_XdS(sContext manager to make an object call as an admin.

        This temporarily modifies the context embedded in an object to
        be elevated() and restores it after the call completes. Example
        usage:

           with obj.obj_as_admin():
               obj.save()

        tmethodtobj_as_admintobjtypeN(R6R)RtOrphanedObjectErrorR
televated(RR8((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR;£s		N(RRt__doc__tOBJ_SERIAL_NAMESPACEtOBJ_PROJECT_NAMESPACEtstaticmethodR%R)RR-t
contextlibtcontextmanagerR9R;(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR!Rs-
tNovaObjectDictCompatcBseZd„Zd„ZRS(ccs>x7|jD],}|j|ƒs.||jkr
|Vq
q
WdS(N(R+R(tobj_extra_fields(RR((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyt__iter__¼scCs
t|ƒS(N(tlist(R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytkeysÂs(RRRGRI(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyRE»s	tNovaTimestampObjectcBs:eZdZiejdeƒd6ejdeƒd6ZRS(sÛMixin class for db backed objects with timestamp fields.

    Sqlalchemy models that inherit from the oslo_db TimestampMixin will include
    these fields and the corresponding objects will benefit from this mixin.
    tnullablet
created_att
updated_at(RRR?R+t
DateTimeFieldR.R(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyRJÆstNovaPersistentObjectcBs`eZdZiejdeƒd6ejdeƒd6ejdeƒd6ejdeƒd6ZRS(suMixin class for Persistent objects.

    This adds the fields that we use in common for most persistent objects.
    RKRLRMt
deleted_attdefaulttdeleted(	RRR?R+RNR.tBooleanFieldRR(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyROÒstObjectListBasecBs,eZed„ƒZeejd„ƒZRS(cCsd|S(Nsnova_object.%s((RR3((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyt_obj_primitive_keyâscCs:|j|ƒ}|tjkr&||S|j||ƒSdS(N(RUR+tUnspecifiedDefaulttget(Rt	primitiveR3RQtkey((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyt_obj_primitive_fieldæs(RRR RUR+RVRZ(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyRTßstNovaObjectSerializercBsAeZdZed„ƒZd„Zd„Zd„Zd„ZRS(s;A NovaObject-aware Serializer.

    This implements the Oslo Serializer interface and provides the
    ability to serialize and deserialize NovaObject entities. Any service
    that needs to accept or return NovaObjects as arguments or result values
    should pass this to its RPCClient and RPCServer objects.
    cCs8t|dƒs1ddlm}|jƒ|_n|jS(Nt
_conductoriÿÿÿÿ(t	conductor(RR#R]tAPIR\(RR]((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR]ùscCsÆytj|d|ƒ}Wn¦tjk
rÁ|d}|jdƒdkr{dj|jdƒd ƒ|d<|j||ƒS|d}tj	|ƒ}||kr»|j
j|||ƒ}q‚nX|S(NR7snova_object.versiont.isnova_object.name(R!tobj_from_primitivetovoo_exctIncompatibleObjectVersiontcounttjointsplitt_process_objectt	ovoo_basetobj_tree_get_versionsR]tobject_backport_versions(RR7tobjprimtobjinsttobjvertobjnametversion_manifest((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyRfs
 
	cs}|j}t|tƒr>|‡‡fd†tj|ƒDƒS|tkrSt}n|g|D]}ˆˆ|ƒ^q]ƒSdS(soProcess an iterable, taking an action on each value.
        :param:context: Request context
        :param:action_fn: Action to take on each item in values
        :param:values: Iterable container of things to take action on
        :returns: A new container of the same type (except set) with
                  items from values having had action applied.
        cs(i|]\}}ˆˆ|ƒ|“qS(((t.0tktv(t	action_fnR7(sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pys
<dictcomp>s	N(t	__class__t
issubclasstdicttsixt	iteritemsR1RH(RR7RrtvaluestiterableR4((RrR7sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyt_process_iterables		cCsgt|ttttfƒr6|j||j|ƒ}n-t|dƒrct|j	ƒrc|j	ƒ}n|S(Ntobj_to_primitive(
R*ttupleRHR1RuRztserialize_entityRtcallableR{(RR7tentity((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR}*scCsjt|tƒr0d|kr0|j||ƒ}n6t|ttttfƒrf|j||j|ƒ}n|S(Nsnova_object.name(R*RuRfR|RHR1Rztdeserialize_entity(RR7R((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR€3s(	RRR?tpropertyR]RfRzR}R€(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR[ðs				cCsÓt|tƒr,g|D]}t|ƒ^qSt|tƒr“i}xK|jD]@}|j|ƒso||jkrKtt||ƒƒ||<qKqKW|St|tj	ƒr¯t
|ƒSt|tjƒrËt
|ƒS|SdS(sšRecursively turn an object into a python primitive.

    A NovaObject becomes a dict, and anything that implements ObjectListBase
    becomes a list.
    N(R*RTR{R!R+R(RFRtnetaddrt	IPAddresststrt	IPNetwork(tobjtxtresultRY((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR{<s 

cCs“i}xZ|D]R}t||ƒ}||krK|ƒ||<g||_n||jj|ƒq
Wx)|D]!}|||_||jƒqjW|S(s Construct a dictionary of object lists, keyed by item_key.

    :param:context: Request context
    :param:list_cls: The ObjectListBase class
    :param:obj_list: The list of objects to place in the dictionary
    :param:item_key: The object attribute name to use as a dictionary key
    (RRRR6R-(R7tlist_clstobj_listtitem_keyt	obj_listsR†RY((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytobj_make_dict_of_listsRs	



cKs\g|_x9|D]1}|j||ƒ||}|jj|ƒqW||_|jƒ|S(sãConstruct an object list from a list of primitives.

    This calls item_cls._from_db_object() on each item of db_list, and
    adds the resulting object to list_obj.

    :param:context: Request context
    :param:list_obj: An ObjectListBase object
    :param:item_cls: The NovaObject class of the objects within the list
    :param:db_list: The list of primitives to convert to objects
    :param:extra_args: Extra arguments to pass to _from_db_object()
    :returns: list_obj
    (Rt_from_db_objectRR6R-(R7tlist_objtitem_clstdb_listt
extra_argstdb_itemtitem((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyt
obj_make_lisths
	
		
csY‡fd†}tˆdtƒ|_ˆ|_tˆdƒrOtjˆƒ|ƒSt|ƒS(sCDecorator that will do the arguments serialization before remoting.cs&g|D]-}t|tjƒr.tj|ƒn|^q}x±tj|ƒD] \}}|dkr~|r~tj|ƒ||<qJ|dkrÂ|rÂt|tjƒrÂdjt	j
|ƒƒ||<qJt|tjƒrJtj|ƒ||<qJqJWtˆdƒr
ˆ|||ŽSˆjd|ƒ||ŽS(Ntexc_valtexc_tbtt__call__(R*tdatetimeRtstrtimeRvRwt	text_typetstring_typesRdt	tracebackt	format_tbRt__get__R)(R†targstkwargstargRpRq(tfn(sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytwrappers7%t	remotableR™(RRR¦toriginal_fnRt	functoolstwrapsR (R¤R¥((R¤sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytserialize_argss
	"csh‡fd†‰|dk	r+dg|}n	dg}ˆ|jƒ|ƒ}ˆ|jƒ|ƒ}||kS(sDCompare two primitives for equivalence ignoring some keys.

    This operation tests the primitives of two objects for equivalence.
    Object primitives may contain a list identifying fields that have been
    changed - this is ignored in the comparison. The ignore parameter lists
    any other keys to be ignored.

    :param:obj1: The first object in the comparison
    :param:obj2: The second object in the comparison
    :param:ignore: A list of fields to ignore
    :returns: True if the primitives are equal ignoring changes
    and specified fields, otherwise False.
    cs‹t|tƒrWx|D]}|j|dƒqWx$|jƒD]}ˆ||ƒq=Wnt|tƒr‡x|D]}ˆ||ƒqmWn|S(N(R*RutpopR)RxRH(tprimRIRpRq(t_strip(sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyR­¦s

snova_object.changesN(R)R{(tobj_1tobj_2tignoreRItprim_1tprim_2((R­sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pytobj_equal_prims—s	(+R?RCRšR¨RžR‚toslo_messagingt	messagingt
oslo_utilsRtoslo_versionedobjectsRRgRRaRvR#Rtnova.objectsRR+RRtVersionedObjectRegistryR	tremotable_classmethodR¦tVersionedObjectR!tVersionedObjectDictCompatREtobjectRJRORTtNoOpSerializerR[R{RR•RªR)R³(((sF/home/tvault/.virtenv/lib/python2.7/site-packages/nova/objects/base.pyt<module>s:	$		i
L