Ejemplo n.º 1
0
def                     check_still_valid_credentials(self):
    servers = Credential.objects.all()
    for server in servers:
        if ssh.connect(server.hostname, server.username, server.password) is False:
            server.delete()
Ejemplo n.º 2
0
def                     test_credentials(self, credentials):
    if ssh.connect(credentials["hostname"], credentials["username"], credentials["password"]) is True:
        ssh.persist_valid_credential(credentials["hostname"], credentials["username"], credentials["password"])
    print(credentials["username"] + ":" + credentials["password"] + "@" + credentials["hostname"])