Exemple #1
0
    def __init__(self):
        auth_composite = self._auth_composite()
        self.user = auth_composite._auth_user_config
        self.servers = ServersComposite(auth_composite)
        self.flavors = FlavorsComposite(auth_composite)
        self.images = ImagesComposite(auth_composite)
        self.keypairs = KeypairsComposite(auth_composite)
        self.console_output = ConsoleOutputComposite(auth_composite)
        self.rescue = RescueComposite(auth_composite)
        self.extension = ExtensionComposite(auth_composite)
        self.vnc_console = VncConsoleComposite(auth_composite)
        self.limits = LimitsComposite(auth_composite)
        self.quotas = QuotasComposite(auth_composite)
        self.hypervisors = HypervisorsComposite(auth_composite)
        self.cells = CellsComposite(auth_composite)
        self.hosts = HostsComposite(auth_composite)
        self.volume_attachments = VolumeAttachmentsComposite(auth_composite)
        self.boot_from_volume = BootFromVolumeComposite(auth_composite)
        self.config_drive = ConfigDriveComposite(auth_composite)
        self.security_groups = SecurityGroupsComposite(auth_composite)

        self.servers.behaviors = self.servers.behavior_class(
            servers_client=self.servers.client,
            images_client=self.images.client,
            servers_config=self.servers.config,
            images_config=self.images.config,
            flavors_config=self.flavors.config,
            security_groups_config=self.security_groups.config)

        self.boot_from_volume.behaviors = \
            self.boot_from_volume.behavior_class(
                servers_client=self.servers.client,
                images_client=self.images.client,
                servers_config=self.servers.config,
                images_config=self.images.config,
                flavors_config=self.flavors.config,
                server_behaviors=self.servers.behaviors,
                boot_from_volume_client=self.boot_from_volume.client,)

        self.images.behaviors = self.images.behavior_class(
            self.images.client, self.servers.client, self.images.config)

        self.config_drive.behaviors = self.config_drive.behavior_class(
            servers_client=self.servers.client,
            servers_config=self.servers.config,
            server_behaviors=self.servers.behaviors)
class ComputeComposite(object):
    _auth_composite = _ComputeAuthComposite

    def __init__(self):
        auth_composite = self._auth_composite()
        self.user = auth_composite._auth_user_config
        self.servers = ServersComposite(auth_composite)
        self.flavors = FlavorsComposite(auth_composite)
        self.images = ImagesComposite(auth_composite)
        self.keypairs = KeypairsComposite(auth_composite)
        self.console_output = ConsoleOutputComposite(auth_composite)
        self.rescue = RescueComposite(auth_composite)
        self.vnc_console = VncConsoleComposite(auth_composite)
        self.limits = LimitsComposite(auth_composite)
        self.quotas = QuotasComposite(auth_composite)
        self.hypervisors = HypervisorsComposite(auth_composite)
        self.cells = CellsComposite(auth_composite)
        self.hosts = HostsComposite(auth_composite)
        self.volume_attachments = VolumeAttachmentsComposite(auth_composite)
        self.boot_from_volume = BootFromVolumeComposite(auth_composite)
        self.config_drive = ConfigDriveComposite(auth_composite)
        self.security_groups = SecurityGroupsComposite(auth_composite)
        self.floating_ips = FloatingIPsComposite(auth_composite)

        self.servers.behaviors = self.servers.behavior_class(
            servers_client=self.servers.client,
            images_client=self.images.client,
            servers_config=self.servers.config,
            images_config=self.images.config,
            floating_ips_client=self.floating_ips.client,
            flavors_config=self.flavors.config,
            security_groups_config=self.security_groups.config)

        self.boot_from_volume.behaviors = \
            self.boot_from_volume.behavior_class(
                servers_client=self.servers.client,
                images_client=self.images.client,
                servers_config=self.servers.config,
                images_config=self.images.config,
                flavors_config=self.flavors.config,
                server_behaviors=self.servers.behaviors,
                security_groups_config=self.security_groups.config,
                boot_from_volume_client=self.boot_from_volume.client,)

        self.images.behaviors = self.images.behavior_class(
            self.images.client, self.servers.client, self.images.config)

        self.config_drive.behaviors = self.config_drive.behavior_class(
            servers_client=self.servers.client,
            servers_config=self.servers.config,
            server_behaviors=self.servers.behaviors)