Example #1
0
    def __init__(self):
        self.isolated_creds = credentials.get_credentials_provider(
            self.__class__.__name__, network_resources={})
        primary_credentials = self.primary_credentials()
        self._manager = clients.Manager(credentials=primary_credentials)

        # Underlying clients.
        self.flavors_client = self._manager.flavors_client
        self.floating_ips_client = self._manager.floating_ips_client

        # Glance image client v1
        self.image_client = self._manager.image_client

        # Compute image client
        self.images_client = self._manager.images_client
        self.keypairs_client = self._manager.keypairs_client
        self.availability_zone_client = self._manager.availability_zone_client

        # Nova security groups client
        self.security_groups_client = self._manager.security_groups_client
        self.security_group_rules_client = \
            self._manager.security_group_rules_client

        self.servers_client = self._manager.servers_client
        self.volumes_client = self._manager.volumes_client
        self.snapshots_client = self._manager.snapshots_client
        self.interface_client = self._manager.interfaces_client

        # Neutron network client
        self.network_client = self._manager.network_client
        self.networks_client = self._manager.networks_client

        # Heat client
        self.orchestration_client = self._manager.orchestration_client
Example #2
0
    def __init__(self):
        self.isolated_creds = credentials.get_credentials_provider(
            self.__class__.__name__, network_resources={})
        primary_credentials = self.primary_credentials()
        self._manager = clients.Manager(credentials=primary_credentials)

        # Underlying clients.
        self.flavors_client = self._manager.flavors_client
        self.floating_ips_client = self._manager.floating_ips_client

        # Glance image client v1
        self.image_client = self._manager.image_client

        # Compute image client
        self.images_client = self._manager.images_client
        self.keypairs_client = self._manager.keypairs_client
        self.availability_zone_client = self._manager.availability_zone_client

        # Nova security groups client
        self.security_groups_client = self._manager.security_groups_client
        self.security_group_rules_client = \
            self._manager.security_group_rules_client

        self.servers_client = self._manager.servers_client
        self.volumes_client = self._manager.volumes_client
        self.snapshots_client = self._manager.snapshots_client
        self.interface_client = self._manager.interfaces_client

        # Neutron network client
        self.network_client = self._manager.network_client
        self.networks_client = self._manager.networks_client
        self.subnets_client = self._manager.subnets_client

        # Heat client
        self.orchestration_client = self._manager.orchestration_client
Example #3
0
 def __init__(self):
     network_resources = {"network": False, "router": False, "subnet": False, "dhcp": False}
     self.cred_provider = credentials.get_credentials_provider(
         name="InputScenarioUtils", identity_version=CONF.identity.auth_version, network_resources=network_resources
     )
     os = clients.Manager(self.cred_provider.get_primary_creds())
     self.images_client = os.images_client
     self.flavors_client = os.flavors_client
     self.image_pattern = CONF.input_scenario.image_regex
     self.flavor_pattern = CONF.input_scenario.flavor_regex
Example #4
0
 def __init__(self):
     network_resources = {
         'network': False,
         'router': False,
         'subnet': False,
         'dhcp': False,
     }
     self.cred_provider = credentials.get_credentials_provider(
         name='InputScenarioUtils',
         identity_version=CONF.identity.auth_version,
         network_resources=network_resources)
     os = clients.Manager(self.cred_provider.get_primary_creds())
     self.images_client = os.images_client
     self.flavors_client = os.flavors_client
     self.image_pattern = CONF.input_scenario.image_regex
     self.flavor_pattern = CONF.input_scenario.flavor_regex
Example #5
0
    def _get_credentials_provider(cls):
        """Returns a credentials provider

        If no credential provider exists yet creates one.
        It uses self.identity_version if defined, or the configuration value
        """
        if (not hasattr(cls, '_creds_provider') or not cls._creds_provider or
                not cls._creds_provider.name == cls.__name__):
            force_tenant_isolation = getattr(cls, 'force_tenant_isolation',
                                             False)

            cls._creds_provider = credentials.get_credentials_provider(
                name=cls.__name__, network_resources=cls.network_resources,
                force_tenant_isolation=force_tenant_isolation,
                identity_version=cls.get_identity_version())
        return cls._creds_provider
Example #6
0
    def _get_credentials_provider(cls):
        """Returns a credentials provider

        If no credential provider exists yet creates one.
        It uses self.identity_version if defined, or the configuration value
        """
        if (not hasattr(cls, '_creds_provider') or not cls._creds_provider
                or not cls._creds_provider.name == cls.__name__):
            force_tenant_isolation = getattr(cls, 'force_tenant_isolation',
                                             False)

            cls._creds_provider = credentials.get_credentials_provider(
                name=cls.__name__,
                network_resources=cls.network_resources,
                force_tenant_isolation=force_tenant_isolation,
                identity_version=cls.get_identity_version())
        return cls._creds_provider
def main():
    print('Running config verification...')
    opts = parse_args()
    update = opts.update
    replace = opts.replace_ext
    global CONF_PARSER

    outfile = sys.stdout
    if update:
        conf_file = _get_config_file()
        if opts.output:
            outfile = open(opts.output, 'w+')
        CONF_PARSER = moves.configparser.SafeConfigParser()
        CONF_PARSER.optionxform = str
        CONF_PARSER.readfp(conf_file)
    icreds = credentials.get_credentials_provider('verify_tempest_config')
    try:
        os = clients.Manager(icreds.get_primary_creds())
        services = check_service_availability(os, update)
        results = {}
        for service in ['nova', 'cinder', 'neutron', 'swift']:
            if service not in services:
                continue
            results = verify_extensions(os, service, results)

        # Verify API versions of all services in the keystone catalog and
        # keystone itself.
        services.append('keystone')
        for service in services:
            verify_api_versions(os, service, update)

        display_results(results, update, replace)
        if update:
            conf_file.close()
            CONF_PARSER.write(outfile)
        outfile.close()
    finally:
        icreds.clear_creds()
Example #8
0
def main():
    print('Running config verification...')
    opts = parse_args()
    update = opts.update
    replace = opts.replace_ext
    global CONF_PARSER

    outfile = sys.stdout
    if update:
        conf_file = _get_config_file()
        if opts.output:
            outfile = open(opts.output, 'w+')
        CONF_PARSER = moves.configparser.SafeConfigParser()
        CONF_PARSER.optionxform = str
        CONF_PARSER.readfp(conf_file)
    icreds = credentials.get_credentials_provider('verify_tempest_config')
    try:
        os = clients.Manager(icreds.get_primary_creds())
        services = check_service_availability(os, update)
        results = {}
        for service in ['nova', 'cinder', 'neutron', 'swift']:
            if service not in services:
                continue
            results = verify_extensions(os, service, results)

        # Verify API versions of all services in the keystone catalog and
        # keystone itself.
        services.append('keystone')
        for service in services:
            verify_api_versions(os, service, update)

        display_results(results, update, replace)
        if update:
            conf_file.close()
            CONF_PARSER.write(outfile)
        outfile.close()
    finally:
        icreds.clear_creds()