예제 #1
0
    def discover(self, initial_nodes, private_key):
        j = joker.Joker(default_key=private_key)
        count = 0
        for node in parse_nodes_info(initial_nodes):
            self.logger.debug("Adding node to joker: %s" % node)
            j.addNode('node%d' % count,
                      host=node['host'],
                      port=node['port'],
                      user=node['username'])

        nodes = []
        for j_node_info in j.discover():
            node = dict(
                name=j_node_info['name'],
                host=j_node_info['ip'],
                port=j_node_info['port'],
                username=j_node_info['user'],
                private_key=j_node_info['key'],
            )
            # proxy_command=j_node_info['proxy_command'])
            node = dict((k, v) for k, v in node.iteritems() if v)
            nodes.append(node)

        return nodes
예제 #2
0
"""
@program: jihuomaIDEA
@description: 
@author: [email protected]
@create: 2020-06-30 01:35
"""

import counter
import joker

addons = [
    # counter.Counter(),
    joker.Joker()
]