403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/monitor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyc
ó
}9Rc@sœddlZddlZddlZddlZddlmZmZmZmZddl	m
Z
ddlmZddl
mZdefd„ƒYZdS(iÿÿÿÿN(tfetcht
HTTPCodeErrortPyCurlErrort
FetchError(tCoverageMonitor(tget_active_device_info(t
MonitorPlugintSwiftDeviceInfocBs}eZdZddejddd„Zd„Zd„Zed„Zd	„Z	d
„Z
d„Zd„Zd
„Z
d„ZRS(sswift-device-infoi,i<s/etc/swift/object-server.confs/etc/swift/object.ring.gzcCsp||_||_||_t|_t|_||_||_d|_
||_g|_g|_t
|_dS(N(trun_intervalt_monitor_intervalt_create_timeRt_fetchRt_get_network_devicest
_swift_configt_swift_ringtNonet_swift_recon_urlt_swift_device_infot_swift_device_info_to_persisttTruetenabled(tselftintervaltmonitor_intervaltcreate_timetswift_configt
swift_ring((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyt__init__s											cCs’tt|ƒj|ƒt|jddd|jƒ|_|jjj	|j
|jjƒ|jjjd|jjddƒ|j
d|jtƒdS(Ngš™™™™™é?sswift device info snapshotRtstoptpriorityiÐsswift-device-info(tsuperRtregisterRRR
t_monitortregistrytreactort
call_everyR	tlogtcall_ontcall_on_acceptedt
send_messagesR(RR!((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyR!s
"cCs>|jr:idd6|jd6}|j|_g|_|SdS(Nsswift-device-infottype(RRR(Rtmessage((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyt create_swift_device_info_message+s	


	csWˆjƒ}|rStjdƒˆjjj|d|ƒ}|j‡fd†ƒndS(Ns0Queueing message with updated swift device info.turgentcs
ˆjƒS(N(tpersist_swift_info(tx(R(sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyt<lambda>9s(R*tloggingtinfoR!tbrokertsend_messagetaddCallback(RR+R)td((RsE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyR'4s

cCs|jjjd|jƒdS(Nsswift-device-info(R!R1tcall_if_acceptedR'(R((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pytexchange;scCsZx=|jD]2}|d}|j|f}|jj||ƒq
Wd|_|jjƒdS(Ntdevice(Rtpersist_namet_persisttsetRR!tflush(Rtswift_device_infotdevice_nametkey((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyR,?s
	cCs|js
dS|jjƒ|jƒ}g}x~|D]v}|d}|j|ƒ|j|f}|jj|ƒ}|s„||kr3||jkr©|jj|ƒq©q3q3W|jj|jƒ}|r
x?|j	ƒD].}||krÕ|jj
|j|fƒqÕqÕWndS(NR7(RR tpingt_get_swift_devicestappendR8R9tgetRtkeystremove(Rtcurrent_swift_devicestcurrent_device_namest
swift_infoR=R>tprev_swift_infotpersisted_devices((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pytrunJs$	



cCsI|j}tjj|ƒs<t|_tjd|jƒgS|j	dkr|jƒ}|dkrggS|jƒ}g|D]}|d^qz}xF|j
D];}|rš|d|kršd|d|df|_	PqšqšW|j	dkrt|_tjd|jƒgSn|jƒ}g|D]&}id|dd6|d	d	6^qS(
NsQThis does not appear to be a swift storage server. '%s' plugin has been disabled.t
ip_addresstipshttp://%s:%d/recon/diskusagetports=Local swift service not found. '%s' plugin has been disabled.s/dev/%sR7tmounted(R
tostpathtexiststFalseRR/R0R8RRt	_get_ringRtdevsterrort_get_swift_disk_usage(Rtconfig_filetringtnetwork_devicesR7t	local_ipstdevtrecon_disk_info((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyR@as6			cCs¹d}y|j|jƒ}WnJtk
r7}d}n2ttfk
rh}d|jt|ƒf}nX|dk	rœt|_t	j
d||jfƒdS|s¦dStj
|ƒ}|S(s
        Query the swift storage usage data by parsing the curled recon data
        from http://localhost:<_swift_service_port>/recon/diskusage.
        Lots of recon data for the picking described at:
        http://docs.openstack.org/developer/swift/admin_guide.html
        s5Swift service is running without swift-recon enabled.s&Swift service not available at %s. %s.s!%s '%s' plugin has been disabled.N(RRRRRRtstrRRRR/RUR8tjsontloads(Rt
error_messagetcontentRUtswift_disk_usages((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyRVŠs"			cCsytjj|jƒs&tjdƒdSyddlm}Wn/t	k
rkt
|_tjd|j
ƒdSX||jƒS(s6Return ring-file object from self._swift_ring locations'Swift ring files are not available yet.iÿÿÿÿ(tRingsGSwift python common libraries not found. '%s' plugin has been disabled.N(RORPRQRR/twarningRtswift.common.ringRctImportErrorRRRRUR8(RRc((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyRS§s
	i(t__name__t
__module__R8ttimeRRR*RRR'R6R,RJR@RVRS(((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyRs	
						)	(R/RiROR^tlandscape.lib.fetchRRRRtlandscape.lib.monitorRtlandscape.lib.networkRtlandscape.monitor.pluginRR(((sE/usr/lib/python2.7/dist-packages/landscape/monitor/swiftdeviceinfo.pyt<module>s"

Youez - 2016 - github.com/yon3zu
LinuXploit