Exemplo n.º 1
0
    def render(self):
        "Pick or create a cloud to bootstrap a new controller on"
        track_screen("Cloud Select")

        all_clouds = juju.get_clouds()
        compatible_clouds = juju.get_compatible_clouds()
        cloud_types = juju.get_cloud_types_by_name()
        # filter to only public clouds
        public_clouds = sorted(name for name, info in all_clouds.items()
                               if info['defined'] == 'public')
        # filter to custom clouds
        # exclude localhost because we treat that as "configuring a new cloud"
        custom_clouds = sorted(name for name, info in all_clouds.items()
                               if info['defined'] != 'public'
                               and cloud_types[name] != 'localhost')

        excerpt = app.config.get('description',
                                 "Where would you like to deploy?")

        self.view = CloudView(app,
                              public_clouds,
                              custom_clouds,
                              compatible_clouds,
                              cb=self.finish)

        if 'localhost' in compatible_clouds:
            app.log.debug(
                "Starting watcher for verifying LXD server is available.")
            app.loop.create_task(
                self._monitor_localhost(LocalhostProvider(),
                                        self.view._enable_localhost_widget))

        app.ui.set_header(title="Choose a Cloud", excerpt=excerpt)
        app.ui.set_body(self.view)
        app.ui.set_footer('')
Exemplo n.º 2
0
    def render(self):
        "Pick or create a cloud to bootstrap a new controller on"
        track_screen("Cloud Select")

        all_clouds = juju.get_clouds()
        compatible_clouds = juju.get_compatible_clouds()
        cloud_types = juju.get_cloud_types_by_name()
        # filter to only public clouds
        public_clouds = sorted(
            name for name, info in all_clouds.items()
            if info['defined'] == 'public' and
            cloud_types[name] in compatible_clouds)
        # filter to custom clouds
        # exclude localhost because we treat that as "configuring a new cloud"
        custom_clouds = sorted(
            name for name, info in all_clouds.items()
            if info['defined'] != 'public' and
            cloud_types[name] != 'localhost' and
            cloud_types[name] in compatible_clouds)

        excerpt = app.config.get(
            'description',
            "Where would you like to deploy?")
        view = CloudView(app,
                         public_clouds,
                         custom_clouds,
                         cb=self.finish)

        app.ui.set_header(
            title="Choose a Cloud",
            excerpt=excerpt
        )
        app.ui.set_body(view)
        app.ui.set_footer('Please press [ENTER] on highlighted '
                          'Cloud to proceed.')
Exemplo n.º 3
0
    def render(self, going_back=False):
        "Pick or create a cloud to bootstrap a new controller on"
        all_clouds = juju.get_clouds()
        compatible_clouds = juju.get_compatible_clouds()
        cloud_types = juju.get_cloud_types_by_name()
        # filter to only public clouds
        public_clouds = sorted(name for name, info in all_clouds.items()
                               if info['defined'] == 'public')
        # filter to custom clouds
        # exclude localhost because we treat that as "configuring a new cloud"
        custom_clouds = sorted(name for name, info in all_clouds.items()
                               if info['defined'] != 'public'
                               and cloud_types[name] != 'localhost')

        prev_screen = self.prev_screen
        if app.alias_given or (app.spell_given and not app.addons):
            # we were given an alias (so spell and addons are locked)
            # or we were given a spell and there are no addons to change
            # so we disable the back button
            prev_screen = None
        self.view = CloudView(app,
                              public_clouds,
                              custom_clouds,
                              compatible_clouds,
                              cb=self.finish,
                              back=prev_screen)

        if 'localhost' in compatible_clouds:
            app.log.debug(
                "Starting watcher for verifying LXD server is available.")
            self.cancel_monitor.clear()
            app.loop.create_task(self._monitor_localhost(LocalhostProvider()))
        self.view.show()
Exemplo n.º 4
0
    def render(self):
        clouds = list_clouds()
        excerpt = app.config.get(
            'description', "Please select from a list of available clouds")
        view = CloudView(app, clouds, self.finish)

        app.ui.set_header(title="Choose a Cloud", excerpt=excerpt)
        app.ui.set_body(view)
Exemplo n.º 5
0
    def render(self):
        clouds = list_clouds()
        excerpt = app.config.get(
            'description', "Please select from a list of available clouds")
        view = CloudView(app, clouds, self.finish)

        app.ui.set_header(title="Choose a Cloud", excerpt=excerpt)
        app.ui.set_body(view)
        app.ui.set_footer('Please press [ENTER] on highlighted '
                          'Cloud to proceed.')
Exemplo n.º 6
0
    def render(self):
        "Pick or create a cloud to bootstrap a new controller on"
        track_screen("Cloud Select")
        clouds = list_clouds()
        excerpt = app.config.get(
            'description', "Please select from a list of available clouds")
        view = CloudView(app, clouds, cb=self.finish)

        app.ui.set_header(title="Choose a Cloud", excerpt=excerpt)
        app.ui.set_body(view)
        app.ui.set_footer('Please press [ENTER] on highlighted '
                          'Cloud to proceed.')
Exemplo n.º 7
0
    def render(self):
        "Pick or create a cloud to bootstrap a new controller on"
        track_screen("Cloud Select")

        compatible_clouds = juju.get_compatible_clouds()
        all_clouds = juju.get_clouds()
        clouds = []

        for k, v in all_clouds.items():
            if v['type'] in compatible_clouds:
                clouds.append(k)

        excerpt = app.config.get(
            'description', "Please select from a list of available clouds")
        view = CloudView(app, sorted(clouds), cb=self.finish)

        app.ui.set_header(title="Choose a Cloud", excerpt=excerpt)
        app.ui.set_body(view)
        app.ui.set_footer('Please press [ENTER] on highlighted '
                          'Cloud to proceed.')