当前位置: 首页>>代码示例>>Python>>正文


Python lang.Boolean类代码示例

本文整理汇总了Python中java.lang.Boolean的典型用法代码示例。如果您正苦于以下问题:Python Boolean类的具体用法?Python Boolean怎么用?Python Boolean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Boolean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DiscoveryMain

def DiscoveryMain(Framework):
    shell = None
    try:
        try:
            protocolName = __getProtocolName(Framework)
            discoverSharePointUrls = Boolean.parseBoolean(Framework.getParameter('discoverSharePointUrls'))
            reportIntermediateWebService = Framework.getParameter('reportIntermediateWebService')
            if reportIntermediateWebService:
                reportIntermediateWebService = Boolean.parseBoolean(reportIntermediateWebService)
            else:
                #set default value
                reportIntermediateWebService = 1
            relativeCommandTimeoutMultiplier = Framework.getParameter('relativeCommandTimeoutMultiplier')
            relativeCommandTimeoutMultiplier = int(relativeCommandTimeoutMultiplier)
            client = Framework.createClient()
            shell = ShellFactory().createShell(client)
            logger.debug('getting SharePoint discoverer for protocol %s' % protocolName)
            discoverer = sharepoint_win_shell.getDiscoverer(shell, protocolName, relativeCommandTimeoutMultiplier)
            logger.debug('got discoverer')
            resources = _discoverSharePoint(discoverer)
            resources.build()
            return resources.report(discoverSharePointUrls, reportIntermediateWebService)
        except SharePointException:
            logger.reportError()
            logger.debugException('')
        except JavaException, ex:
            strException = ex.getMessage()
            errormessages.resolveAndReport(strException, protocolName, Framework)
        except:
            strException = logger.prepareJythonStackTrace('')
            errormessages.resolveAndReport(strException, protocolName, Framework)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:31,代码来源:SharePointMain.py

示例2: DiscoveryMain

def DiscoveryMain(Framework):
    Framework = jee_connection.EnhancedFramework(Framework)
    port = entity.WeakNumeric(int)
    port.set(Framework.getDestinationAttribute('port'))
    version = Framework.getDestinationAttribute('version')

    resultVector = ObjectStateHolderVector()
    isAppResourcesDiscoveryEnabled = Boolean.valueOf(Framework.getParameter('discoverAppResources'))
    isJMSResourcesDiscoveryEnabled = Boolean.valueOf(Framework.getParameter('discoverJMSResources'))
    discoverDeployedOnlyApplications = Boolean.valueOf(Framework.getParameter("discoverDeployedOnlyApplications"))
    protocolType = (Framework.getDestinationAttribute('protocol') or
                    ClientsConsts.HTTP_PROTOCOL_NAME)

    properties = Properties()
    properties.put(CollectorsConstants.PROTOCOL_ATTRIBUTE_PORT, str(port.value()))
    properties.put(AgentConstants.VERSION_PROPERTY, version)
    properties.put(AgentConstants.PROP_WEBLOGIC_PROTOCOL, protocolType)

    platform = jee.Platform.WEBLOGIC

    try:
        client = Framework.createClient(properties)
    except (Exception, JException), exc:
        logger.warnException("Failed to establish connection")
        jee_connection.reportError(Framework, str(exc), platform.getName())
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:25,代码来源:JMX_J2EE_WebLogic.py

示例3: start

 def start(self):
     "start enabler"
     
     logger.info("Enter start")
     copyContainerEnvironment()
     self.__initOptions()
      
     if self.__composeFile:
         self.__composeCreate()
         self.__composeStart()
         self.__composePs()
     else:
         reuseContainer = Boolean.parseBoolean(getVariableValue("REUSE_DOCKER_CONTAINER", "false"))
         reuseImage = Boolean.parseBoolean(getVariableValue("REUSE_DOCKER_IMAGE", "true"))
     
         llen = len(self.__dockerContainerName)
         for index in range(llen):
             if reuseContainer and self.__containerExists(index):
                 self.__start(index)
             elif reuseImage and self.__imageExists(index):
                 self.__run(index)
             elif listItem(self.__dockerContext, index):
                 self.__build(index)
                 self.__run(index)
             else:
                 self.__pull(index)
                 self.__run(index)
         
             while index < (llen - 1):
                 logger.info("Waiting for container to start:" + listItem(self.__dockerContainerName, index))
                 time.sleep(float(self.__startInterval))
                 if self.__isContainerRunning(index):
                     break
   
     logger.info("Exit start")
开发者ID:ajayvohra2005,项目名称:simple-docker-enabler,代码行数:35,代码来源:SimpleDockerEnabler.py

示例4: initializeServices

    def initializeServices(self):
        self.discoverDependLinks = 1
        self.shouldCountClients = 0
        self.updateUtilizationInfo = Boolean.parseBoolean(self.getParameterValue('updateUtilizationInfo'))
        self.onlyHostDependLinks = Boolean.parseBoolean(self.getParameterValue('onlyHostDependLinks'))
        self.ignoreUnackedTcpConn = Boolean.parseBoolean(self.getParameterValue('ignoreUnackedTcpConn'))

        self.minimalClients = 0
        self.minimalOctets = 0
        self.minimalPackets = 0
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:10,代码来源:Netlinks_Servers.py

示例5: DiscoveryMain

def DiscoveryMain(Framework):
    properties = Properties()

    SITE_ID = Framework.getDestinationAttribute('SITE_ID')
    instance_number = Framework.getDestinationAttribute('instance_number')
    connection_client = Framework.getDestinationAttribute('connection_client')
    logger.debug('Connecting to a SAP instance number:', str(instance_number))
    properties.setProperty(Protocol.SAP_PROTOCOL_ATTRIBUTE_SYSNUMBER, instance_number)

    if (connection_client is not None) and (connection_client != 'NA'):
        logger.debug('Connecting to a SAP system with client:', str(connection_client))
        properties.setProperty(Protocol.SAP_PROTOCOL_ATTRIBUTE_CLIENT, connection_client)
    discoverScenarioProcesses = Boolean.parseBoolean(Framework.getParameter('discoverScenarioProcesses'))
    GET_PROCESS_STEPS = Boolean.parseBoolean(Framework.getParameter('getProcessSteps'))
    reportCIsInChunks = Boolean.parseBoolean(Framework.getParameter('reportCIsInChunks'))

    errormsg = ''
    client = None
    try:
        try:
            client = Framework.createClient(properties)
            solman = saputils.SapSolman(client)
        except (NoClassDefFoundError, MissingJarsException, ExceptionInInitializerError):
            errormsg = 'SAP drivers are missing'
            logger.debugException(errormsg)
        except:
            errormsg = 'Connection failed'
            logger.debugException(errormsg)
        else:
            try:
                sVector, sysToOshPairs = discoverSystems(solman)
                Framework.sendObjects(sVector)
                sVector.clear()
                sysNames = [system.getName() for system, _ in sysToOshPairs]
                sys_name_to_system = {}
                for system, _ in sysToOshPairs:
                    sys_name_to_system[system.getName()] = system

                component2system = logicalComponents(sysNames, solman)
                businessProcesses(Framework, solman, component2system,
                                  sys_name_to_system, SITE_ID, GET_PROCESS_STEPS, reportCIsInChunks,
                                  discoverScenarioProcesses)
            except:
                strmsg = str(sys.exc_info()[1])
                if (strmsg.upper().find('TABLE_NOT_AVAILABLE') > -1):
                    errmsg = 'No solution manager found'
                    logger.debugException(errmsg)
                    Framework.reportError(errmsg)
                else:
                    # unknown exception caught
                    raise
    except JException, ex:
        ex_info = ex.getMessage()
        errormessages.resolveAndReport(ex_info, 'SAP JCO', Framework)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:54,代码来源:sap_solution_manager.py

示例6: isStampEnabled

def isStampEnabled(Framework, ip):
    from java.lang import Boolean

    enableStampingParameter = Framework.getParameter('enableStamping')
    onlyStampingClientParameter = Framework.getParameter('onlyStampingClient')
    logger.debug("Parameter for enableStamping:", enableStampingParameter)
    logger.debug("Parameter for onlyStampingClient:", onlyStampingClientParameter)
    enableStamping = Boolean.parseBoolean(enableStampingParameter)
    onlyStampingClient = Boolean.parseBoolean(onlyStampingClientParameter)
    isClientIP = isClientTypeIP(ip)

    return enableStamping and (not onlyStampingClient or isClientIP)
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:12,代码来源:HostConnectionByShell.py

示例7: _obtainParams

def _obtainParams(framework):
    zoneNameList = framework.getParameter("zoneList")
    splitRegexp = re.compile("[,;]")
    isNonEmptyString = lambda s: s and s.strip()
    zoneNameList = filter(isNonEmptyString, map(string.strip, splitRegexp.split(zoneNameList)))

    from java.lang import Boolean

    includeOutscopeIPs = framework.getParameter("includeOutscopeIPs")
    includeOutscopeIPs = Boolean.valueOf(includeOutscopeIPs)

    reportBrokenAliases = framework.getParameter("reportBrokenAliases")
    reportBrokenAliases = Boolean.valueOf(reportBrokenAliases)
    return zoneNameList, includeOutscopeIPs, reportBrokenAliases
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:14,代码来源:dns_zone_by_remote_shell.py

示例8: initializeServices

    def initializeServices(self):
        self.updateUtilizationInfo = 1
        self.discoverDependLinks = Boolean.parseBoolean(self.getParameterValue('discoverDependLinks'))
        self.onlyHostDependLinks = 0
        self.ignoreUnackedTcpConn = 0
        self.shouldCountClients = 1

        self.discoverIP = self.Framework.getDestinationAttribute('ip_address')
        self.hostId = self.Framework.getDestinationAttribute('hostId')
        self.minimalClients = Integer.parseInt(self.Framework.getParameter('minClients'))
        self.minimalOctets = Integer.parseInt(self.Framework.getParameter('minOctets'))
        self.minimalPackets = Integer.parseInt(self.Framework.getParameter('minPackets'))
        self.protocols = self.Framework.getParameter('protocols')
        self.disregardListenPorts = Boolean.parseBoolean(self.getParameterValue('disregardListenPorts'))
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:14,代码来源:Netlinks_Potential_Servers.py

示例9: __activate__

    def __activate__(self, context):
        self.velocityContext = context
        self.services = context["Services"]
        self.request = context["request"]
        self.response = context["response"]
        self.contextPath = context["contextPath"]
        self.formData = context["formData"]
        self.page = context["page"]

        self.uaActivated = False
        useDownload = Boolean.parseBoolean(self.formData.get("download", "true"))
        self.__isPreview = Boolean.parseBoolean(self.formData.get("preview", "false"))
        self.__previewPid = None
        self.__hasPid = False

        uri = URLDecoder.decode(self.request.getAttribute("RequestURI"))
        matches = re.match("^(.*?)/(.*?)/(?:(.*?)/)?(.*)$", uri)
        if matches and matches.group(3):
            oid = matches.group(3)
            pid = matches.group(4)

            self.__metadata = JsonConfigHelper()
            self.__object = self.__getObject(oid)
            self.__oid = oid

            # If we have a PID
            if pid:
                self.__hasPid = True
                if useDownload:
                    # Download the payload to support relative links
                    download = DownloadData()
                    download.__activate__(context)
                else:
                    # Render the detail screen with the alternative preview
                    self.__readMetadata(oid)
                    self.__previewPid = pid
            # Otherwise, render the detail screen
            else:
                self.__readMetadata(oid)
                self.__previewPid = self.getPreview()

            if self.__previewPid:
                self.__previewPid = URLEncoder.encode(self.__previewPid, "UTF-8")
        else:
            # require trailing slash for relative paths
            q = ""
            if self.__isPreview:
                q = "?preview=true"
            self.response.sendRedirect("%s/%s/%s" % (self.contextPath, uri, q))
开发者ID:kiranba,项目名称:the-fascinator,代码行数:49,代码来源:detail.py

示例10: shouldInstallScanner

def shouldInstallScanner(scannerPlatformConfig, Framework, shell):
	shouldInstall = 0
	#staring to check scanner version on remote machine
	isUpgradeAllowed = Boolean.parseBoolean(Framework.getParameter('IsScannerUpgradeAllowed'))
	logger.debug('Parameter isUpgradeAllowed:', isUpgradeAllowed)
	IsDowngradeAllowed = Boolean.parseBoolean(Framework.getParameter('IsScannerDowngradeAllowed'))
	logger.debug('Parameter IsDowngradeAllowed:', IsDowngradeAllowed)

	if isUpgradeAllowed and IsDowngradeAllowed:
		logger.debug('Upgrade and Downgrade allowed, installing scanner in any case')
		shouldInstall = 1
	else:
		remoteScannerVersion = Framework.getDestinationAttribute('scannerVersion')
		if (remoteScannerVersion is None) or (len(str(remoteScannerVersion)) == 0) or (str(remoteScannerVersion) == 'NA'):
			logger.debug('Remote scanner version is unavailable, going to execute scanner upgrade')
			shouldInstall = 1
		else:
			logger.debug('Scanner already found on remote machine')
			installerFileName = scannerPlatformConfig.getScannerExecutable()
			installerVersioninstallerXmlFilePath = CollectorsParameters.PROBE_MGR_RESOURCES_DIR + 'ud_scanners' + str(File.separator) + installerFileName + '-version.xml'
			logger.debug('Checking installer version in file ', installerVersioninstallerXmlFilePath)
			installerXmlFile = File(installerVersioninstallerXmlFilePath)
			if installerXmlFile.exists() and installerXmlFile.isFile():
				installerVersion = getInstallerVersion(installerXmlFile, Framework)
				logger.debug('Current scanner version ', installerVersion)
				m = re.search('([\d\.]+) build ([\d]+)', remoteScannerVersion)
				if m:
					remoteScannerVersion = m.group(1)+'.'+m.group(2)
					logger.debug('Remote scanner version ', remoteScannerVersion)
					if compareVersions(installerVersion, remoteScannerVersion) > 0:
						if isUpgradeAllowed:
							logger.debug('Upgrade should be perfomed')
							shouldInstall = 1
						else:
							logger.debug('Upgrade is not allowed')
					elif compareVersions(installerVersion, remoteScannerVersion) < 0:
						if IsDowngradeAllowed:
							logger.debug('Downgrade should be perfomed')
							shouldInstall = 1
						else:
							logger.debug('Downgrade is not allowed')
				else:
					logger.debug('Scanner should be installed')
					shouldInstall = 1
			else:
				if isUpgradeAllowed:
					logger.debug('Going to upgrade scanner, version file not exists:', installerVersioninstallerXmlFilePath)
					shouldInstall = 1
	return shouldInstall
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:49,代码来源:UpgradeScanner.py

示例11: __activate__

 def __activate__(self, context):
     self.services = context["Services"]
     self.page = context["page"]
     self.formData = context["formData"]
     self.sessionState = context["sessionState"]
     self.request = context["request"]
     self.pageName = context["pageName"]
     
     self.__portal = context["page"].getPortal()
     sessionNav = self.__portal.get("portal/use-session-navigation", "true")
     self.__useSessionNavigation = Boolean.parseBoolean(sessionNav)
     self.__result = JsonConfigHelper()
     if self.__useSessionNavigation:
         self.__pageNum = self.sessionState.get("pageNum", 1)
     else:
         self.__pageNum = 1
     self.__selected = ArrayList()
     self.__fqParts = []
     self.__searchField = self.formData.get("searchField", "full_text")
     
     if self.__portal.getName() != self.lastPortalId:
         self.sessionState.remove("fq")
         self.sessionState.remove("pageNum")
         self.__pageNum = 1
         self.lastPortalId =  self.__portal.getName()
     
     self.__search()
开发者ID:kiranba,项目名称:the-fascinator,代码行数:27,代码来源:search.py

示例12: DiscoveryMain

def DiscoveryMain(Framework):
    OSHVResult = ObjectStateHolderVector()

    logger.info ("Starting IMS Discovery")
    DiscoverIMSDB = Boolean.parseBoolean(Framework.getParameter('DiscoverIMSDB'))

    # create LPAR node from the ID passed in
    hostId = Framework.getDestinationAttribute(PARAM_HOST_ID)
    lparOsh = None

    if eview_lib.isNotNull(hostId):
        lparOsh = modeling.createOshByCmdbIdString('host_node', hostId)

    ls = eview_lib.EvShell(Framework)
    IMSSubSysDict = getIMSSubSys(ls, lparOsh)
    OSHVResult.addAll(getIMSActRegions(ls,lparOsh, IMSSubSysDict ))


    if DiscoverIMSDB and len(IMSSubSysDict) > 0:
        databaseAreaDictionary = {}
        databaseDictionary = {}
        OSHVResult.addAll(getIMSDB(ls, IMSSubSysDict,  databaseAreaDictionary , databaseDictionary))
        OSHVResult.addAll(getAREAs(ls, IMSSubSysDict,  databaseAreaDictionary , databaseDictionary))
        OSHVResult.addAll(processPrograms(ls,IMSSubSysDict, Framework))
    ls.closeClient()

    logger.info ("Finished IMS Discovery")
    return OSHVResult
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:28,代码来源:eview_ims.py

示例13: __init__

    def __init__(self, Framework):
        Netlinks_Service.NetlinksService.__init__(self, Framework)
        shouldIgnoreLocal = self.getParameterValue('ignoreLocalConnections')
        if shouldIgnoreLocal == None:
            shouldIgnoreLocal = 'false'
        self.ignoreLocalConnections = Boolean.parseBoolean(shouldIgnoreLocal)
        self.dependencyNameIsKey = modeling.checkIsKeyAttribute('dependency', 'dependency_name')
        self.dependencySourceIsKey = modeling.checkIsKeyAttribute('dependency', 'dependency_source')
        ignoredIpsList = self.getParameterValue('ignoredIps')
        self.ignoredIps = None
        if ignoredIpsList != None:
            ipPatterns = ignoredIpsList.split(',')
            if (len(ipPatterns) > 0) and (ipPatterns[0] != ''):
                for ipPattern in ipPatterns:
                    pattern = String(ipPattern)
                    pattern = String(pattern.replaceAll("\.", "\\\."))
                    pattern = String(pattern.replaceAll("\*", "\\\d+"))
                    try:
                        m = Pattern.compile(pattern)
                        if self.ignoredIps == None:
                            self.ignoredIps = ArrayList()
                        self.ignoredIps.add(m)
                    except:
                        logger.debug('Failed to compile ip pattern:', ipPattern)


        self.initializeServices()
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:27,代码来源:Netlinks_Services.py

示例14: __composeDown

 def __composeDown(self):
     
     logger.info("Enter docker compose down")
     try:
         project = getVariableValue("DOCKER_COMPOSE_PROJECT", self.__compName)
         cmdlist=[self.__dockerCompose, "--file", self.__composeFile, "--project-name", project, "down"]
         removeImage = Boolean.parseBoolean(getVariableValue("REMOVE_DOCKER_IMAGE", "false"))
        
         if removeImage:
             cmdlist.extend(["--rmi", "all"])
             
         removeOptions = getVariableValue("DOCKER_REMOVE_OPTIONS")
         if removeOptions and removeOptions.find("--volumes=true") >= 0:
             cmdlist.append("--volumes")
             
         logger.info("Executing:"+ list2str(cmdlist))
         os.environ["DOCKER_HOST"] = "tcp://" + self.__dockerAddr
         os.environ["COMPOSE_HTTP_TIMEOUT"] = "300"
         self.__lock()
         retcode = call(cmdlist)
         logger.info("Return code:" + str(retcode))
     except:
         type, value, traceback = sys.exc_info()
         logger.severe("composeDown error:" + `value`)
         raise
     finally:
         self.__unlock()
             
     logger.info("Exit docker compose down")
开发者ID:ajayvohra2005,项目名称:simple-docker-enabler,代码行数:29,代码来源:SimpleDockerEnabler.py

示例15: disHPUX

def disHPUX(host_obj, client, Framework = None, langBund = None, pid2Process = None):
	hostId = Framework.getDestinationAttribute('hostId')
	discoverProcesses = Boolean.parseBoolean(Framework.getParameter('discoverProcesses'))

	myVec = ObjectStateHolderVector()
	
	# Better format, but not supported on all HPUX systems
	#r = client.executeCmd('ps -e -o pid,time,sz,comm,args')
	r = client.execCmd('ps -ef')#[email protected]@CMD_PERMISION tty protocol execution
	if r == None:
		return myVec

	lines = ''
	if(re.search('\r\n',r)):
		lines = r.split('\r\n')
	elif (re.search('\n',r)):
		lines = r.split('\n')
	else:
		return myVec
	processList = []
	pdu = None
	try:
		pdu = processdbutils.ProcessDbUtils(Framework)
		hostOSH = None
		for line in lines:
			## Reg for processes with args
			res = re.search('(\w+)\s+(\d+).*\s\d+\:\d\d\s([0-9a-zA-Z_.\[\]\-+:/]+)\s(.*)',line)
			if(res):
				cleanArgs = res.group(4)
			else:
				## Reg for processes with no args
				res = re.search('(\w+)\s+(\d+).*\s\d+\:\d\d\s([0-9a-zA-Z_.\-+:/]+)',line)
				if(res):
					cleanArgs = ''
			if(res):
				owner = res.group(1)
				commAndPath = res.group(3)
				pid = res.group(2)
				cleanCommand = ''
				if commAndPath.find('/') == -1:
					cleanCommand = commAndPath
				else:
					res2 = re.search('(.*/)([^/]+)',commAndPath)
					if (res2):
						cleanCommand = res2.group(2)
					else:
						continue
				if hostOSH == None:
					hostOSH = modeling.createOshByCmdbIdString('host', hostId)
				
				commandLine = cleanCommand + ' ' + cleanArgs
				addProcess(pdu, hostId, cleanCommand, pid, commandLine, commAndPath, cleanArgs, processList, discoverProcesses, myVec, hostOSH, None, owner)

		pdu.flushHostProcesses(hostId)
		if pid2Process is not None:
			pid2Process.putAll(pdu.getProcessCmdMap())
	finally:
		if pdu != None:
			pdu.close()
	return myVec
开发者ID:ddonnelly19,项目名称:dd-git,代码行数:60,代码来源:TTY_HR_Process_Lib.py


注:本文中的java.lang.Boolean类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。