Ejemplo n.º 1
0
def set_ssh_info():
    form = request.form
    username = form.get('username')
    key = form.get('key')
    if username and key:
        hosts.set_ssh_user(username)
        hosts.set_ssh_key(key)
        flash(messages.SSH_INFO_UPDATED, 'success')
    return redirect(url_for('admin.index'))
Ejemplo n.º 2
0
def set_ssh_info():
    form = request.form
    username = form.get('username')
    key = form.get('key')
    if username and key:
        hosts.set_ssh_user(username)
        hosts.set_ssh_key(key)
        flash(messages.SSH_INFO_UPDATED, 'success')
    return redirect(url_for('admin.index'))
 def test_set_ssh_user(self):
     self.assertTrue(hosts.set_ssh_user(self.test_ssh_user))
     self.assertEqual(hosts.get_ssh_user(), self.test_ssh_user)