def freeze(h, output_yaml, resolve, groups):
    """Output installed packages."""
    if not groups:
        groups = filter(lambda group: not group.lower().startswith("bower"),
                        h.requirements.keys())
    else:
        groups = [text_type.strip(group) for group in groups.split(",")]

    if output_yaml:
        for requirements in h.requirements.values():
            for requirement in requirements:
                if resolve and not requirement.version:
                    requirement.load_installed_version()
        click.echo(h.requirements.yaml)
    else:
        for group in groups:
            if not h.requirements[group]:
                continue
            click.echo("# {}".format(group))
            for requirement in h.requirements[group]:
                if resolve and not requirement.version:
                    requirement.load_installed_version()
                click.echo(str(requirement))
def test_volume_bootable(self):
        """Test setting and retrieving bootable flag of a volume"""
        for bool_bootable in [True, False]:
            self.volumes_client.set_bootable_volume(self.volume['id'],
                                                    bootable=bool_bootable)
            fetched_volume = self.volumes_client.show_volume(
                self.volume['id'])['volume']
            # Get Volume information
            # NOTE(masayukig): 'bootable' is "true" or "false" in the current
            # cinder implementation. So we need to cast boolean values to str
            # and make it lower to compare here.
            self.assertEqual(str(bool_bootable).lower(),
                             fetched_volume['bootable'])