コード例 #1
0
ファイル: __init__.py プロジェクト: zonda80/trigger
    def _set_node_port(self):
        """Set the freakin' TCP port"""
        # If nodename is set, try to parse out a nodePort
        if self.nodeName is not None:
            nodeport_info = parse_node_port(self.nodeName)
            nodeName, nodePort = nodeport_info

            # If the nodeName differs, use it to replace the one we parsed
            if nodeName != self.nodeName:
                self.nodeName = nodeName

            # If the port isn't set, set it
            if nodePort is not None:
                self.nodePort = nodePort
                return None

        # Make sure the port is an integer if it's not None
        if self.nodePort is not None and isinstance(self.nodePort, basestring):
            self.nodePort = int(self.nodePort)
コード例 #2
0
ファイル: __init__.py プロジェクト: cyclops3590/trigger
    def _set_node_port(self):
        """Set the freakin' TCP port"""
        # If nodename is set, try to parse out a nodePort
        if self.nodeName is not None:
            nodeport_info = parse_node_port(self.nodeName)
            nodeName, nodePort = nodeport_info

            # If the nodeName differs, use it to replace the one we parsed
            if nodeName != self.nodeName:
                self.nodeName = nodeName

            # If the port isn't set, set it
            if nodePort is not None:
                self.nodePort = nodePort
                return None

        # Make sure the port is an integer if it's not None
        if self.nodePort is not None and isinstance(self.nodePort, basestring):
            self.nodePort = int(self.nodePort)