/usr/lib/python2.6/site-packages/openstackclient/common
NameSizeModeActions
availability_zone.py66280644editdlrm
availability_zone.pyc65520644editdlrm
clientmanager.py91920644editdlrm
clientmanager.pyc77810644editdlrm
command.py13010644editdlrm
command.pyc18950644editdlrm
commandmanager.py20870644editdlrm
commandmanager.pyc24440644editdlrm
configuration.py19140644editdlrm
configuration.pyc20300644editdlrm
context.py60910644editdlrm
context.pyc48280644editdlrm
exceptions.py37900644editdlrm
exceptions.pyc56830644editdlrm
extension.py45090644editdlrm
extension.pyc36410644editdlrm
limits.py39950644editdlrm
limits.pyc34820644editdlrm
logs.py72290644editdlrm
logs.pyc57850644editdlrm
module.py24290644editdlrm
module.pyc28050644editdlrm
parseractions.py24720644editdlrm
parseractions.pyc22930644editdlrm
quota.py78590644editdlrm
quota.pyc61000644editdlrm
session.py16270644editdlrm
session.pyc18090644editdlrm
timing.py13930644editdlrm
timing.pyc12400644editdlrm
utils.py136450644editdlrm
utils.pyc139690644editdlrm
__init__.py00644editdlrm
__init__.pyc1660644editdlrm
Edit: /usr/lib/python2.6/site-packages/openstackclient/common/utils.pyc (13969B)
Ñò ;vVc @s2dZddkZddkZddkZddkZddkZddklZddkl Z ei d„Z d„Z d„Z d„Zd „Zghd „Zghd „Zd „Zd „Zd„Zd„Zddgddd„Zddddd„Zd„Zded„Zd„Zd„ZdS(sCommon client utilitiesiÿÿÿÿN(t importutils(t exceptionscs‡‡fd†}|S(s-Logs a method and its arguments when entered.cs4ˆi‰tiˆƒ‡‡‡‡fd†ƒ}|S(Ncs–ˆiˆƒovg}|o|id„|Dƒƒn|o$|id„ti|ƒDƒƒnˆiˆdˆdi|ƒƒnˆ|||ŽS(Ncssx|]}t|ƒVqWdS(N(tstr(t.0ta((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pys (s css)x"|]\}}d||fVqWdS(s%s=%sN((Rtktv((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pys +s s%s(%s)s, (t isEnabledFortextendtsixt iteritemstlogtjoin(tselftargstkwargst pretty_args(tfuncR tlevelt func_name(sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytwrapper#s#(t__name__R twraps(RR(R R(RRsL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pyt decorator s ' ((R RR((R RsL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pyt log_methodsc KsŸy8t|tƒp |iƒo|it|ƒ|SWn2tj o&}t|ƒidjoqm‚nXy|i||SWntj onXt|ƒdjo h}nd|ii jo|||ii R?(R8R@RARBRCR9RDR1((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytget_dict_properties·s   cs|p|St|ƒ}|iƒidƒ}xÚt|ƒD]̉t}dˆjo”ˆiddƒ\‰}ˆpd}ti|ƒ‚n|d jo4|p d}nd|ˆf}ti|ƒ‚n|djo t}qçn|id ‡fd †d |ƒq:W|S( s™Sort items based on sort keys and sort directions given by sort_str. :param items: a list or generator object of items :param sort_str: a string defining the sort rules, the format is ':[direction1],:[direction2]...', direction can be 'asc' for ascending or 'desc' for descending, if direction is not given, it's ascending by default :return: sorted items t,t:is$empty string is not a valid sort keytasctdescs empty stringsI%s is not a valid sort direction for sort key %s, use asc or desc insteadtkeycs t|ˆƒS((R:(R8(tsort_key(sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytístreverse(RIsdesc( tlisttstriptsplittreversedtFalseRR(tTruetsort(titemstsort_strt sort_keysRNt directionR,((RLsL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pyt sort_itemsÏs.         cCs|iƒiƒdjS(Nttttruetyest1(R[struesyesR^(RPR'(targ((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytstring_to_boolòscOsBx/|D]'}tii|dƒ}|o|SqW|iddƒS(s¦Search for the first defined of possibly many env vars Returns the first environment variable defined in vars, or returns the default defined in kwargs. tdefaultR.N(tostenvironR tNone(tvarsRRtvalue((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytenvös  cCsny|t|ƒ}WnJttfj o8d||di|iƒƒf}ti|ƒ‚nXti|ƒS(s,Returns the client class for the requested API version :param api_name: the name of the API, e.g. 'compute', 'image', etc :param version: the requested API version :param version_map: a dict of client classes keyed by version :rtype: a client class for the requested API version s2Invalid %s client version '%s'. must be one of: %ss, ( RtKeyErrort ValueErrorR tkeysRtUnsupportedVersionRt import_class(tapi_nametversiont version_mapt client_pathR,((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytget_client_classststatustactiveic Cs¢x›to“||ƒ}t||dƒiƒ}||jo t}Pn|djo t}Pn|o't|ddƒpd} || ƒnti|ƒqW|S(síWait for status change on a resource during a long-running operation :param status_f: a status function that takes a single id argument :param res_id: the resource id to watch :param success_status: a list of status strings for successful completion :param status_field: the status attribute in the returned resource object :param sleep_time: wait this long (seconds) :param callback: called per sleep cycle, useful to display progress :rtype: True on success R.terrortprogressiN(RTR7R'RSRdttimetsleep( tstatus_ftres_idt status_fieldtsuccess_statust sleep_timetcallbacktresRrtretvalRu((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytwait_for_statuss   i,c Cs×d}xÊ||jo¼y|i|ƒ}Wn3tj o'}t|ƒidjotS‚nXt||dƒiƒ} | djotS|o't|ddƒpd} || ƒnt i |ƒ||7}q WtS(s…Wait for resource deletion :param res_id: the resource id to watch :param status_field: the status attribute in the returned resource object, this is used to check for error states while the resource is being deleted :param sleep_time: wait this long between checks (seconds) :param timeout: check until this long (seconds) :param callback: called per sleep cycle, useful to display progress; this function is passed a progress value during each iteration of the wait loop :rtype: True on success, False if the resource has gone to error state or the timeout has been reached iRR.RtRuN( R R!R"RRTR7R'RSRdRvRw( R)RyRzR|ttimeoutR}t total_timeR~R+RrRu((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytwait_for_delete5s$   cCs?tiƒ}ti}x#|iD]}t||iƒ}qW|S(s¼Returns the lowest logging level considered by logging handlers Retrieve an return the smallest log level set among the root logger's handlers (in case of multiple handlers). (tloggingt getLoggertCRITICALthandlerstminR(troot_logt min_log_lvlthandler((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytget_effective_log_levelcs    cCs¾|pd}t|dƒoŽ|iƒoyXxQtoIti|ƒ}|p|Stid|ƒ}||jo|SdGHq0WWq«tj otidƒ‚q«Xntidƒ‚dS(NsUser Password:tisattysRepeat s'The passwords entered were not the samesError reading password.sRThere was a request to be prompted for a password and a terminal was not detected.(thasattrRRTtgetpasstEOFErrorRR((tstdintprompttconfirmtmessaget first_passt second_pass((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pyt get_passwordps  cCsvyCt|ƒiiƒ}z|~}|iƒiƒ}WdQX|SWn,tj o d}ti||ƒ‚nXdS(Ns*Error occurred trying to read from file %s(topent__exit__t __enter__treadRPtIOErrorRR((t blob_filet_[1]tfiletblobR,((sL/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/common/utils.pytread_blob_file_contents‚s#cCsh}|o|||s<      H   #    )