示例#1
0
    def run(self, ram, vcpus, disk, flavorid="auto",
            ephemeral=0, swap=0, rxtx_factor=1.0, is_public=True):
        """Create a non-public flavor and list its access rules

        :param ram: Memory in MB for the flavor
        :param vcpus: Number of VCPUs for the flavor
        :param disk: Size of local disk in GB
        :param flavorid: ID for the flavor (optional). You can use the reserved
                         value ``"auto"`` to have Nova generate a UUID for the
                         flavor in cases where you cannot simply pass ``None``.
        :param ephemeral: Ephemeral space size in GB (default 0).
        :param swap: Swap space in MB
        :param rxtx_factor: RX/TX factor
        :param is_public: Make flavor accessible to the public (default true).
        """
        # NOTE(pirsriva): access rules can be listed
        # only for non-public flavors
        if is_public:
            LOG.warning(_LW("is_public cannot be set to True for listing "
                            "flavor access rules. Setting is_public to False"))
        is_public = False
        flavor = self._create_flavor(ram, vcpus, disk, flavorid=flavorid,
                                     ephemeral=ephemeral, swap=swap,
                                     rxtx_factor=rxtx_factor,
                                     is_public=is_public)
        self.assertTrue(flavor)

        self._list_flavor_access(flavor.id)
示例#2
0
文件: utils.py 项目: joylhx/Rally
 def __init__(self, context=None, admin_clients=None, clients=None):
     super(KeystoneScenario, self).__init__(context, admin_clients, clients)
     LOG.warning(
         _LW("Class %s is deprecated since Rally 0.8.0 and will be removed "
             "soon. Use "
             "rally.plugins.openstack.services.identity.identity.Identity "
             "instead.") % self.__class__)
示例#3
0
 def __init__(self, context=None, admin_clients=None, clients=None):
     super(CinderScenario, self).__init__(context, admin_clients, clients)
     LOG.warning(
         _LW("Class %s is deprecated since Rally 0.10.0 and will be removed "
             "soon. Use "
             "rally.plugins.openstack.services.storage.block.BlockStorage "
             "instead.") % self.__class__)
示例#4
0
文件: deploy.py 项目: tiansen87/rally
 def __getitem__(self, key):
     # TODO(astudenov): remove this in future releases
     if key == "admin" or key == "users":
         LOG.warning(_LW("deployment.%s is deprecated in Rally 0.9.0. "
                         "Use deployment.get_credentials_for('openstack')"
                         "['%s'] to get credentials.") % (key, key))
         return self.get_credentials_for("openstack")[key]
     return self.deployment[key]
示例#5
0
def _publisher(publish, queue):
    """Calls a publish method that fills queue with jobs.

    :param publish: method that fills the queue
    :param queue: deque object to be filled by the publish() method
    """
    try:
        publish(queue)
    except Exception as e:
        LOG.warning(_LW("Failed to publish a task to the queue: %s") % e)
        if logging.is_debug():
            LOG.exception(e)
示例#6
0
    def create_and_list_flavor_access(self, ram, vcpus, disk, **kwargs):
        """Create a non-public flavor and list its access rules

        :param ram: Memory in MB for the flavor
        :param vcpus: Number of VCPUs for the flavor
        :param disk: Size of local disk in GB
        :param kwargs: Optional additional arguments for flavor creation
        """
        # NOTE(pirsriva): access rules can be listed
        # only for non-public flavors
        if kwargs.get("is_public", False):
            LOG.warning(_LW("is_public cannot be set to True for listing "
                            "flavor access rules. Setting is_public to False"))
        kwargs["is_public"] = False
        flavor = self._create_flavor(ram, vcpus, disk, **kwargs)
        self._list_flavor_access(flavor.id)
示例#7
0
def _consumer(consume, queue):
    """Infinity worker that consumes tasks from queue.

    :param consume: method that consumes an object removed from the queue
    :param queue: deque object to popleft() objects from
    """
    cache = {}
    while True:
        if not queue:
            break
        else:
            try:
                args = queue.popleft()
            except IndexError:
                # consumed by other thread
                continue
        try:
            consume(cache, args)
        except Exception as e:
            LOG.warning(_LW("Failed to consume a task from the queue: %s") % e)
            if logging.is_debug():
                LOG.exception(e)
示例#8
0
文件: api.py 项目: gotostack/rally
 def __getattr__(self, attr, default=None):
     LOG.warning(
         _LW("'%s' is deprecated since Rally 0.8.0 in favor of "
             "'rally.api.API' class.") % self._cls.__name__[1:])
     return getattr(self._cls, attr, default)