Beispiel #1
0
 def args_from_node(cls, node, overrides=None, defaults=None):
     if overrides is None:
         overrides = {}
     if defaults is None:
         defaults = {}
     params = ChainMap(overrides, node, defaults)
     return {
         'user': params['user'],
         'host': params['ip'],
         'port': params.get('ssh_port', cls.SSH_PORT),
         'pkey': params.get('pkey'),
         'key_filename': params.get('key_filename'),
         'password': params.get('password'),
         'name': params.get('name'),
     }
Beispiel #2
0
 def from_node(cls, node, overrides=None, defaults=None):
     if overrides is None:
         overrides = {}
     if defaults is None:
         defaults = {}
     params = ChainMap(overrides, node, defaults)
     return cls(
         user=params['user'],
         host=params['ip'],
         # paramiko doesn't like None default, requires SSH_PORT default
         port=params.get('ssh_port', SSH_PORT),
         pkey=params.get('pkey'),
         key_filename=params.get('key_filename'),
         password=params.get('password'),
         name=params.get('name'))