ó ±2öYc@sddlZddlmZmZddlmZddlmZddl j Z ddl m Z dgZ ejjƒZddd„ƒYZdS( iÿÿÿÿN(t ConfigObjtConfigObjError(t Validator(tTunedException(tcommandst GlobalConfigcBs{eZdejdejdejdejgZd„Zej d„Z d d„Z d d„Z d„Zd d „ZRS( s$dynamic_tuning = boolean(default=%s)s$sleep_interval = integer(default=%s)s%update_interval = integer(default=%s)s'recommend_command = boolean(default=%s)cCs#i|_|jƒtƒ|_dS(N(t_cfgt load_configRt_cmd(tself((s=/usr/lib/python2.7/site-packages/tuned/utils/global_config.pyt__init__s  c CsÅtjd|ƒy4t|d|jdtdtdtdtƒ|_WnEtk rj}td|ƒ‚n#t k rŒ}td|ƒ‚nXt ƒ}|jj |d tƒsÁtd |ƒ‚nd S( s& Loads global configuration file. s2reading and parsing global configuration file '%s't configspect raise_errorst file_errort list_valuest interpolations/Global tuned configuration file '%s' not found.s3Error parsing global tuned configuration file '%s'.tcopys2Global tuned configuration file '%s' is not valid.N( tlogtdebugRtglobal_config_spectTruetFalseRtIOErrorRRRtvalidate(R t file_nametetvdt((s=/usr/lib/python2.7/site-packages/tuned/utils/global_config.pyRs cCs|jj||ƒS(N(Rtget(R tkeytdefault((s=/usr/lib/python2.7/site-packages/tuned/utils/global_config.pyR(scCs,|jj|j||ƒƒdkr(tStS(Nt1(Rtget_boolRRR(R RR((s=/usr/lib/python2.7/site-packages/tuned/utils/global_config.pyR+s$cCs||j|s