コード例 #1
0
ファイル: gui.py プロジェクト: battlemidget/conjure-up
    def finish(self, needs_lxd_setup=False, lxdnetwork=None, back=False):
        """ Processes the new LXD setup and loads the controller to
        finish bootstrapping the model.

        Arguments:
        back: if true loads previous controller
        needs_lxd_setup: if true prompt user to run lxd init
        """
        if back:
            return controllers.use('clouds').render()

        if needs_lxd_setup:
            EventLoop.remove_alarms()
            EventLoop.exit(1)

        if lxdnetwork is None:
            return app.ui.show_exception_message(
                Exception("Unable to configure LXD network bridge."))

        formatted_network = self.__format_input(lxdnetwork)
        app.log.debug("LXD Config {}".format(formatted_network))

        out = self.__format_conf(formatted_network)

        with NamedTemporaryFile(mode="w", encoding="utf-8",
                                delete=False) as tempf:
            app.log.debug("Saving LXD config to {}".format(tempf.name))
            utils.spew(tempf.name, out)
            sh = utils.run('sudo mv {} /etc/default/lxd-bridge'.format(
                tempf.name), shell=True)
            if sh.returncode > 0:
                return app.ui.show_exception_message(
                    Exception("Problem saving config: {}".format(
                        sh.stderr.decode('utf8'))))

        app.log.debug("Restarting lxd-bridge")
        utils.run("sudo systemctl restart lxd-bridge.service", shell=True)

        utils.pollinate(app.session_id, 'L002')
        controllers.use('newcloud').render(
            cloud='localhost', bootstrap=True)
コード例 #2
0
    def finish(self, needs_lxd_setup=False, lxdnetwork=None, back=False):
        """ Processes the new LXD setup and loads the controller to
        finish bootstrapping the model.

        Arguments:
        back: if true loads previous controller
        needs_lxd_setup: if true prompt user to run lxd init
        """
        if back:
            return controllers.use('clouds').render()

        if needs_lxd_setup:
            EventLoop.remove_alarms()
            EventLoop.exit(1)

        if lxdnetwork is None:
            return app.ui.show_exception_message(
                Exception("Unable to configure LXD network bridge."))

        formatted_network = self.__format_input(lxdnetwork)
        app.log.debug("LXD Config {}".format(formatted_network))

        out = self.__format_conf(formatted_network)

        with NamedTemporaryFile(mode="w", encoding="utf-8",
                                delete=False) as tempf:
            app.log.debug("Saving LXD config to {}".format(tempf.name))
            utils.spew(tempf.name, out)
            sh = run('sudo mv {} /etc/default/lxd-bridge'.format(
                tempf.name), shell=True)
            if sh.returncode > 0:
                return app.ui.show_exception_message(
                    Exception("Problem saving config: {}".format(
                        sh.stderr.decode('utf8'))))

        app.log.debug("Restarting lxd-bridge")
        run("sudo systemctl restart lxd-bridge.service", shell=True)

        utils.pollinate(app.session_id, 'L002')
        controllers.use('newcloud').render(
            cloud='localhost', bootstrap=True)
コード例 #3
0
ファイル: app.py プロジェクト: pombredanne/conjure
 def unhandled_input(self, key):
     if key in ['q', 'Q']:
         EventLoop.exit(0)
コード例 #4
0
ファイル: deploy.py プロジェクト: battlemidget/conjure-up
 def cancel(self, btn):
     EventLoop.exit(0)
コード例 #5
0
ファイル: gui.py プロジェクト: graywen24/conjure-up
 def finish(self):
     EventLoop.remove_alarms()
     EventLoop.exit(0)
コード例 #6
0
 def cancel(self, btn):
     EventLoop.exit(0)
コード例 #7
0
ファイル: variant.py プロジェクト: battlemidget/conjure-up
 def cancel(self, button):
     pollinate(app.session_id, 'UC')
     EventLoop.exit(0)
コード例 #8
0
ファイル: variant.py プロジェクト: johnsca/conjure-up
 def cancel(self, button):
     EventLoop.exit(0)
コード例 #9
0
ファイル: variant.py プロジェクト: conjure-up/conjure-up
 def cancel(self, button):
     EventLoop.exit(0)
コード例 #10
0
ファイル: destroy.py プロジェクト: johnsca/conjure-up
def unhandled_input(key):
    if key in ['q', 'Q']:
        async .shutdown()
        EventLoop.exit(0)
コード例 #11
0
ファイル: app.py プロジェクト: tych0/conjure-up
def unhandled_input(key):
    if key in ['q', 'Q']:
        async.shutdown()
        EventLoop.exit(0)
コード例 #12
0
 def done_cb(self):
     log.debug("done_cb called")
     EventLoop.exit(0)
コード例 #13
0
 def cancel(self, button):
     pollinate(app.session_id, 'UC')
     EventLoop.exit(0)
コード例 #14
0
ファイル: gui.py プロジェクト: johnsca/conjure-up
 def finish(self):
     EventLoop.remove_alarms()
     EventLoop.exit(0)