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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/deployment.pyc
ó
}9Rc@sÞddlZddlZddlmZmZmZmZmZddlm	Z	m
Z
ddlmZmZddl
mZddlmZddlmZd„Zd	efd
„ƒYZdefd„ƒYZd
„ZdS(iÿÿÿÿN(tgetLevelNamet	getLoggertFileHandlert
StreamHandlert	Formatter(tOptionParsert
SUPPRESS_HELP(tConfigParsertNoSectionError(tVERSION(tPersist(tUPGRADE_MANAGERScCsÜg}tjj|jƒs.tj|jƒntjj|j|dƒ}|jt|ƒƒ|js|jt	t
jƒƒntƒj
t|jjƒƒƒx7|D]/}tƒj|ƒd}|jt|ƒƒq¥WdS(s,Given a basic configuration, set up logging.s.logs;%(asctime)s %(levelname)-8s [%(threadName)-10s] %(message)sN(tostpathtexiststlog_dirtmakedirstjointappendRtquietRtsyststdoutRtsetLevelRt	log_leveltuppert
addHandlertsetFormatterR(t
configurationtprogram_namethandlerstlog_filenamethandlertformat((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytinit_loggings	
tBaseConfigurationcBseZdZdZdZdgZejjejj	e
jdƒƒejj	dƒkrkejddƒne
eƒZdZd„Zd„Zd„Zdd	„Zd
„Zd„Zed„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sVBase class for configuration implementations.

    @cvar required_options: Optionally, a sequence of key names to require when
        reading or writing a configuration.
    @cvar unsaved_options: Optionally, a sequence of key names to never write
        to the configuration file.  This is useful when you want to provide
        command-line options that should never end up in a configuration file.
    @cvar default_config_filenames: A sequence of filenames to check when
        reading or writing a configuration.

    Default values for supported options are set as in L{make_parser}.
    s/etc/landscape/client.confitscriptsslandscape-client.conftclientcCsei|_g|_i|_d|_i|_|jƒ|_|jjj	ƒ|_
|jjjƒdS(N(t_set_optionst_command_line_argst_command_line_optionstNonet_config_filenamet_config_file_optionstmake_parsert_parsertdefaultstcopyt_command_line_defaultstclear(tself((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyt__init__8s					cCsÓxw|j|j|j|jgD] }||kr||}PqqW|jjd|jddƒƒrnd}nt|ƒ‚t	|t
ƒrÏ|jjd|jddƒƒ}|dk	rÏ|jd|ƒ}qÏn|S(søFind and return the value of the given configuration parameter.

        The following sources will be searched:
          - The attributes that were explicitly set on this object,
          - The parameters specified on the command line,
          - The parameters specified in the configuration file, and
          - The defaults.

        If no values are found and the parameter does exist as a possible
        parameter, C{None} is returned.

        Otherwise C{AttributeError} is raised.
        s--t_t-N(
R%R'R*R/R,t
has_optiontreplaceR(tAttributeErrort
isinstancet
basestringt
get_optiont
convert_value(R1tnametoptionstvaluetoption((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyt__getattr__Ds	
"	"cCsR|jƒ}|jjƒ|_|jjƒ|_|j|_|jjƒ|_|S(sX
        Return a new configuration object, with the same settings as this one.
        (t	__class__R%R.R'R)R*(R1tconfig((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytclonedscCs*y|j|ƒSWntk
r%|SXdS(s5Return the value of the C{name} option or C{default}.N(R@R7(R1R<tdefault((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytgetos
cCs<|jdƒr+tt|ƒj||ƒn
||j|<dS(s£Set a configuration parameter.

        If the name begins with C{_}, it will only be set on this object and
        not stored in the configuration file.
        R3N(t
startswithtsuperR"t__setattr__R%(R1R<R>((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRHvscCs|j|jƒdS(shReload options using the configured command line arguments.

        @see: L{load_command_line}
        N(tloadR&(R1((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytreloadscCs|j|ƒ|jrtjj|jƒrmtj|jtjƒsZtjd|jƒn|j	|jƒqÇ|sÇtjd|jƒqÇn:x7|j
D],}tj|tjƒr—|j	|ƒPq—q—W|jƒxF|jD];}t
||ƒsÛtjd|jddƒ|fƒqÛqÛWdS(s
        Load configuration data from command line arguments and a config file.

        @raise: A SystemExit if the arguments are bad.
        s#error: config file %s can't be readserror: file not found: %ssBerror: must specify --%s or the '%s' directive in the config file.R3R4N(tload_command_lineRBRR
tisfiletaccesstR_OKRtexittload_configuration_filetdefault_config_filenamest_load_external_optionstrequired_optionstgetattrR6(R1targstaccept_nonexistent_configtpotential_config_fileR?((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRIˆs$
	

	cCsdS(s<Hook for loading options from elsewhere (e.g. for --import).N((R1((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRR¨scCs2||_|jj|ƒd}t|ƒ|_dS(s4Load configuration data from the given command line.iN(R&R,t
parse_argstvarsR'(R1RUtvalues((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRK«s	cCsV||_tƒ}|j|ƒyt|j|jƒƒ|_Wntk
rQnXdS(s²Load configuration data from the given file name.

        If any data has already been set on this configuration object,
        then the old data will take precedence.
        N(R)Rtreadtdicttitemstconfig_sectionR*R(R1tfilenamet
config_parser((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRP±s		

cCs|jƒ}tƒ}|j|ƒ|j|jƒsG|j|jƒn|jjƒ}|j|j	ƒ|j|j
ƒx||jƒD]n\}}|dkrƒ||jkrƒ||j
j|ƒkrØ|j|j|ƒqñ|j|j||ƒqƒqƒWt|dƒ}|j|ƒ|jƒdS(sìWrite back configuration to the configuration file.

        Values which match the default option in the parser won't be saved.

        Options are considered in the following precedence:

          1. Manually set options (C{config.option = value})
          2. Options passed in the command line
          3. Previously existent options in the configuration file

        The filename picked for saving configuration options is the one
        returned by L{get_config_filename}.
        RBtwN(tget_config_filenameRR[thas_sectionR^tadd_sectionR*R.tupdateR'R%R]tunsaved_optionsR/REt
remove_optiontsettopentwritetclose(R1R_R`tall_optionsR<R>tconfig_file((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRjÀs 	

c	CsQtdtƒ}|jddddddƒ|jdd	dd
dddd
ƒ|S(sParser factory for supported options

        @return: An L{OptionParser} preset with options that all
            landscape-related programs accept. These include
              - C{config} (C{None})
              - C{data_path} (C{"/var/lib/landscape/client/"})
        tversions-cs--configtmetavartFILEthelps}Use config from this file (any command line options override settings from the file) (default: '/etc/landscape/client.conf').s-ds--data-pathtPATHRDs/var/lib/landscape/client/sMThe directory to store data files in (default: '/var/lib/landscape/client/').(RR	t
add_option(R1tparser((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyR+åscCse|jr|jS|jr |jS|jrax*|jD]}tj|tjƒr3|Sq3W|jdSdS(sñPick the proper configuration file.

        The picked filename is:
          1. C{self.config}, if defined
          2. The last loaded configuration file, if any
          3. The first filename in C{self.default_config_filenames}
        iN(RBR)RQRRMRNR((R1RW((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRbøs			cCs|jS(sWGet currently loaded command line options.

        @see: L{load_command_line}
        (R'(R1((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytget_command_line_optionss((N(t__name__t
__module__t__doc__RSRfRQRR
tdirnametabspathRtargvtinsertttupleR^R2R@RCR(RERHRJtFalseRIRRRKRPRjR+RbRu(((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyR"!s.	"		 			 				%		t
ConfigurationcBsGeZdZdZd„Zed„Zed„ƒZed„ƒZ	RS(shConfiguration data for Landscape client.

    This contains all simple data, some of it calculated.
    s.https://landscape.canonical.com/message-systemc
Cstt|ƒjƒ}|jdddtddddƒ|jdd	d
ddddd
ƒ|jdddddƒ|jddd|jddƒ|jdddddƒ|jddddƒ|jddddtddƒ|jddddddd ƒ|jd!dddd"dd#ƒ|jd$dddtdd%ƒ|jd&dddtdd'ƒ|jd(dd8dd+dd,ƒ|jd-dd:dd+dd/ƒ|jd0dd;dd+d
d2dd3ƒ|jd4dd5dtdtƒ|jd6dd<dtdtƒ|S(=síParser factory for supported options.

        @return: An L{OptionParser} preset for all options
            from L{BaseConfiguration.make_parser} plus:
              - C{quiet} (C{False})
              - C{log_dir} (C{"/var/log/landscape"})
              - C{log_level} (C{"info"})
              - C{url} (C{"http://landscape.canonical.com/message-system"})
              - C{ping_url} (C{"http://landscape.canonical.com/ping"})
              - C{ssl_public_key}
              - C{server_autodiscover} (C{"false"})
              - C{autodiscover_srv_query_string}
                    (C{"_tcp._landscape.localdomain"})
              - C{autodiscover_a_query_string} (C{"landscape.localdomain"})
              - C{ignore_sigint} (C{False})
        s-qs--quietRDtactiont
store_trueRqs"Do not log to the standard output.s-ls	--log-dirRoRpsDThe directory to write log files to (default: '/var/log/landscape').s/var/log/landscapes--log-leveltinfos/One of debug, info, warning, error or critical.s-us--urlsThe server URL to connect to.s
--ping-urls8The URL to perform lightweight exchange initiation with.s#http://landscape.canonical.com/pings-ks--ssl-public-keysMThe public SSL key to verify the server. Only used if the given URL is https.s--server-autodiscoverttypetstringsEnable server autodiscovery.s--autodiscover-srv-query-strings_landscape._tcp.localdomains(autodiscovery string for DNS SRV queriess--autodiscover-a-query-stringslandscape.localdomains&autodiscovery string for DNS A queriess--ignore-sigintsIgnore interrupt signals.s--ignore-sigusr1s%Ignore SIGUSR1 signal to rotate logs.s--package-monitor-intervalii<tints:The interval between package monitor runs (default: 1800).s--apt-update-intervalis6The interval between apt update runs (default: 21600).s--flush-intervalitINTERVALsBThe number of seconds between flushes to disk for persistent data.s--clonesis--start-clones-overiiihi`Ti,iÜ(RGRR+RsR~tDEFAULT_URLR…R(R1Rt((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyR+sP


cCsYtt|ƒj|d|ƒt|jtƒsUt|jƒjƒ}|dk|_ndS(sX
        Load configuration data from command line arguments and a config file.
        RVttrueN(RGRRIR8tserver_autodiscovertbooltstrtlower(R1RURVtautodiscover((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRI`s

cCstjj|jdƒS(s@Return the path to the directory where Unix sockets are created.tsockets(RR
Rt	data_path(R1((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytsockets_pathkscCstjj|jdƒS(sk
        Return the path to the directory where additional annotation files can
        be stored.
        s
annotations.d(RR
RR(R1((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytannotations_pathps(
RvRwRxR‡R+R~RItpropertyRR‘(((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyRs	EcCsetd|jƒ}t|j}tjj|jƒrD|j|ƒn
|j|ƒ|j	|jƒ|S(s¥Get a L{Persist} database with upgrade rules applied.

    Load a L{Persist} database for the given C{service} and upgrade or
    mark as current, as necessary.
    R_(
R
tpersist_filenameRtservice_nameRR
Rtapplyt
initializetsave(tservicetpersisttupgrade_manager((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pytget_versioned_persistys

(RRtloggingRRRRRtoptparseRRRRt	landscapeR	tlandscape.lib.persistR
tlandscape.upgradersRR!tobjectR"RR›(((s8/usr/lib/python2.7/dist-packages/landscape/deployment.pyt<module>s(	òf

Youez - 2016 - github.com/yon3zu
LinuXploit