"Fossies" - the Fresh Open Source Software Archive

Member "zaqar-10.0.0/zaqar/tests/faulty_storage.py" (13 May 2020, 4737 Bytes) of package /linux/misc/openstack/zaqar-10.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "faulty_storage.py": 9.0.0_vs_10.0.0.

    1 # Copyright (c) 2013 Rackspace, Inc.
    2 #
    3 # Licensed under the Apache License, Version 2.0 (the "License");
    4 # you may not use this file except in compliance with the License.
    5 # You may obtain a copy of the License at
    6 #
    7 #    http://www.apache.org/licenses/LICENSE-2.0
    8 #
    9 # Unless required by applicable law or agreed to in writing, software
   10 # distributed under the License is distributed on an "AS IS" BASIS,
   11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   12 # implied.
   13 # See the License for the specific language governing permissions and
   14 # limitations under the License.
   15 
   16 from oslo_config import cfg
   17 
   18 from zaqar import storage
   19 
   20 _CONFIG_GROUP = 'drivers:message_store:faulty'
   21 
   22 
   23 class DataDriver(storage.DataDriverBase):
   24 
   25     _DRIVER_OPTIONS = [(_CONFIG_GROUP,
   26                         [cfg.StrOpt('uri', default='faulty://')])]
   27 
   28     def __init__(self, conf, cache, control_driver):
   29         super(DataDriver, self).__init__(conf, cache, control_driver)
   30 
   31     def close(self):
   32         pass
   33 
   34     @property
   35     def default_options(self):
   36         return {}
   37 
   38     @property
   39     def capabilities(self):
   40         raise NotImplementedError()
   41 
   42     def is_alive(self):
   43         raise NotImplementedError()
   44 
   45     def _health(self):
   46         raise NotImplementedError()
   47 
   48     @property
   49     def queue_controller(self):
   50         return self.control_driver.queue_controller
   51 
   52     @property
   53     def message_controller(self):
   54         return MessageController(self)
   55 
   56     @property
   57     def claim_controller(self):
   58         return None
   59 
   60     @property
   61     def subscription_controller(self):
   62         return None
   63 
   64     @property
   65     def topic_controller(self):
   66         return self.control_driver.topic_controller
   67 
   68 
   69 class ControlDriver(storage.ControlDriverBase):
   70 
   71     def __init__(self, conf, cache):
   72         super(ControlDriver, self).__init__(conf, cache)
   73 
   74     def close(self):
   75         pass
   76 
   77     @property
   78     def queue_controller(self):
   79         return QueueController(self)
   80 
   81     @property
   82     def catalogue_controller(self):
   83         return None
   84 
   85     @property
   86     def pools_controller(self):
   87         return None
   88 
   89     @property
   90     def flavors_controller(self):
   91         return None
   92 
   93     @property
   94     def topic_controller(self):
   95         return TopicController(self)
   96 
   97 
   98 class QueueController(storage.Queue):
   99     def __init__(self, driver):
  100         pass
  101 
  102     def _list(self, project=None):
  103         raise NotImplementedError()
  104 
  105     def _get(self, name, project=None):
  106         raise NotImplementedError()
  107 
  108     def get_metadata(self, name, project=None):
  109         raise NotImplementedError()
  110 
  111     def _create(self, name, metadata=None, project=None):
  112         raise NotImplementedError()
  113 
  114     def _exists(self, name, project=None):
  115         raise NotImplementedError()
  116 
  117     def set_metadata(self, name, metadata, project=None):
  118         raise NotImplementedError()
  119 
  120     def _delete(self, name, project=None):
  121         raise NotImplementedError()
  122 
  123     def _stats(self, name, project=None):
  124         raise NotImplementedError()
  125 
  126     def _calculate_resource_count(self, project=None):
  127         raise NotImplementedError()
  128 
  129 
  130 class MessageController(storage.Message):
  131     def __init__(self, driver):
  132         pass
  133 
  134     def first(self, queue_name, project=None, sort=1):
  135         raise NotImplementedError()
  136 
  137     def get(self, queue, message_id, project=None):
  138         raise NotImplementedError()
  139 
  140     def bulk_get(self, queue, message_ids, project=None):
  141         raise NotImplementedError()
  142 
  143     def list(self, queue, project=None, marker=None,
  144              limit=None, echo=False, client_uuid=None):
  145         raise NotImplementedError()
  146 
  147     def post(self, queue, messages, project=None):
  148         raise NotImplementedError()
  149 
  150     def pop(self, queue, pop_limit, project=None):
  151         raise NotImplementedError()
  152 
  153     def delete(self, queue, message_id, project=None, claim=None):
  154         raise NotImplementedError()
  155 
  156     def bulk_delete(self, queue, message_ids, project=None, claim_ids=None):
  157         raise NotImplementedError()
  158 
  159 
  160 class TopicController(storage.Topic):
  161     def __init__(self, driver):
  162         pass
  163 
  164     def _list(self, project=None):
  165         raise NotImplementedError()
  166 
  167     def _get(self, name, project=None):
  168         raise NotImplementedError()
  169 
  170     def get_metadata(self, name, project=None):
  171         raise NotImplementedError()
  172 
  173     def _create(self, name, metadata=None, project=None):
  174         raise NotImplementedError()
  175 
  176     def _exists(self, name, project=None):
  177         raise NotImplementedError()
  178 
  179     def set_metadata(self, name, metadata, project=None):
  180         raise NotImplementedError()
  181 
  182     def _delete(self, name, project=None):
  183         raise NotImplementedError()
  184 
  185     def _stats(self, name, project=None):
  186         raise NotImplementedError()