Esempio n. 1
0
             ad_user) = d.inputbox("Please enter your AD username:"******"Please enter your AD password:\n"
                "(note: it will not show in the text field)",
                nocancel=1,
                backtitle=dialog_title)
            d.infobox("Starting SSH tunnel...", 5, 60, backtitle=dialog_title)
            time.sleep(1)
            pfw = PortForwarder(ssh_host='services.hq',
                                username=ad_user,
                                password=ad_pwd)
            pfw.start_port_forward(local_port=4506,
                                   target_host=salt_master,
                                   target_port=4506,
                                   local_address='127.0.0.1',
                                   abort_transfer_on_exit=True)
            time.sleep(2)
            salt_master = 'localhost'

        except Exception, e:
            d.msgbox("SSH tunnel failed. Falling back to direct connection "
                     "(which might not work).\n"
                     "{0}".format(e),
                     7,
                     60,
                     backtitle=dialog_title)

    # Perform a network sanity check for required components
    sanity_check_passed = False