def get_ssh_fingerprint(request, ip_address): """ The resource is used to get the ssh fingerprint from a remote host: """ try: ssh_fingerprint = usm_wrapper_utils.get_host_ssh_key(ip_address) except Exception, e: log.exception(e) return Response( {'message': 'Error while getting fingerprint'}, status=417)
def setup_transport_and_update_db(nodelist): log.debug("Inside setup_transport_and_update_db function") failedNodes = [] # Create the Nodes in the cluster # Setup the host communication channel minionIds = {} for node in nodelist: try: if 'ssh_username' in node and 'ssh_password' in node: ssh_fingerprint = usm_wrapper_utils.get_host_ssh_key( node['management_ip']) minionIds[node['management_ip']] = salt_wrapper.setup_minion( node['management_ip'], ssh_fingerprint[0], node['ssh_username'], node['ssh_password']) else: # Discovered node, add hostname to the minionIds list log.debug("Discovered Node: %s" % node) minionIds[node['management_ip']] = node['node_name'] except Exception, e: log.exception(e) failedNodes.append(node)