Exemplo n.º 1
0
    def finish(self, controller):
        if controller is None:
            app.current_controller = "conjure-up-{}-{}".format(
                app.current_cloud, utils.gen_hash())
            return controllers.use('bootstrap').render()

        if controller == 'jaas':
            if not app.jaas_controller or not juju.has_jaas_auth():
                # jaas is either not registered or not logged in
                return controllers.use('jaaslogin').render()
            # jaas already registered
            app.current_controller = app.jaas_controller
            app.is_jaas = True
        else:
            app.current_controller = controller

        if app.current_controller not in juju.get_controllers()['controllers']:
            return controllers.use('bootstrap').render()

        events.Bootstrapped.set()

        app.loop.create_task(
            juju.add_model(app.current_model, app.current_controller,
                           app.current_cloud))
        return controllers.use('deploy').render()
Exemplo n.º 2
0
    def finish(self, controller):
        if controller is None:
            return controllers.use('clouds').render()

        if controller == 'jaas':
            if not app.jaas_controller or not juju.has_jaas_auth():
                # jaas is either not registered or not logged in
                return controllers.use('jaaslogin').render()
            # jaas already registered, but we they still need to pick a cloud
            app.current_controller = app.jaas_controller
            app.is_jaas = True
            events.Bootstrapped.set()
            return controllers.use('clouds').render()

        app.current_controller = controller
        app.current_model = utils.gen_model()

        c_info = juju.get_controller_info(app.current_controller)
        app.current_cloud = c_info['details']['cloud']

        events.Bootstrapped.set()

        app.loop.create_task(
            juju.add_model(app.current_model, app.current_controller,
                           app.current_cloud))
        return controllers.use('deploy').render()
Exemplo n.º 3
0
 def render_form(self, error):
     if juju.has_jaas_auth() and not error:
         self.register()
         return
     track_screen("Login to JaaS")
     app.ui.set_header(title="Login to JaaS",
                       excerpt='Enter your Ubuntu SSO credentials')
     app.ui.set_body(JaaSLoginView(app, error=error, cb=self.register))
Exemplo n.º 4
0
 def render(self):
     if not app.jaas_ok:
         utils.error('JaaS not compatible with specified cloud')
         return events.Shutdown.set(1)
     if not app.jaas_controller:
         utils.error('No JaaS controller registered')
         return events.Shutdown.set(1)
     if not juju.has_jaas_auth():
         utils.error('JaaS controller not authenticated')
         return events.Shutdown.set(1)
     app.is_jaas = True
     controllers.use('showsteps').render()
Exemplo n.º 5
0
    def finish(self, controller):
        if controller is None:
            app.current_controller = "conjure-up-{}-{}".format(
                app.current_cloud, utils.gen_hash())
        else:
            app.current_controller = controller

        if controller == 'jaas':
            if not app.jaas_controller or not juju.has_jaas_auth():
                # jaas is either not registered or not logged in
                return controllers.use('jaaslogin').render()
            # jaas already registered
            app.current_controller = app.jaas_controller
            app.is_jaas = True
        return controllers.use('showsteps').render()
Exemplo n.º 6
0
 def render(self):
     if not app.jaas_ok:
         utils.error('JaaS not compatible with specified cloud')
         return events.Shutdown.set(1)
     if not app.jaas_controller:
         utils.error('No JaaS controller registered')
         return events.Shutdown.set(1)
     if not juju.has_jaas_auth():
         utils.error('JaaS controller not authenticated')
         return events.Shutdown.set(1)
     app.is_jaas = True
     events.Bootstrapped.set()
     app.loop.create_task(
         juju.add_model(app.current_model, app.current_controller,
                        app.current_cloud))
     controllers.use('deploy').render()