Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.60 KB | None | 0 0
  1. In [114]: conf = cfg.ConfigOpts()
  2.  
  3. In [115]: conf.register_opt(cfg.URIOpt('uri', schemes=["http", "https"]),
  4.      ...:                              cfg.OptGroup(group_name))
  5. Out[115]: True
  6.  
  7. In [116]: conf.register_opt(cfg.URIOpt('uri', schemes=["http", "https"]),
  8.      ...:                              cfg.OptGroup(group_name))
  9. ---------------------------------------------------------------------------
  10. AttributeError                            Traceback (most recent call last)
  11. <ipython-input-116-46e0c7fb2a1c> in <module>()
  12.       1 conf.register_opt(cfg.URIOpt('uri', schemes=["http", "https"]),
  13. ----> 2                              cfg.OptGroup(group_name))
  14.  
  15. /home/moguimar/.ve/oslo.config/lib/python2.7/site-packages/oslo_config/cfg.pyc in __inner(self, *args, **kwargs)
  16.    2433         def __inner(self, *args, **kwargs):
  17.    2434             if kwargs.pop('clear_cache', True):
  18. -> 2435                 result = f(self, *args, **kwargs)
  19.    2436                 self.__cache.clear()
  20.    2437                 return result
  21.  
  22. /home/moguimar/.ve/oslo.config/lib/python2.7/site-packages/oslo_config/cfg.pyc in register_opt(self, opt, group, cli)
  23.    2607                 self._add_cli_opt(opt, group)
  24.    2608             self._track_deprecated_opts(opt, group=group)
  25. -> 2609             return group._register_opt(opt, cli)
  26.    2610
  27.    2611         # NOTE(gcb) We can't use some names which are same with attributes of
  28.  
  29. /home/moguimar/.ve/oslo.config/lib/python2.7/site-packages/oslo_config/cfg.pyc in _register_opt(self, opt, cli)
  30.    1903         :raises: DuplicateOptError if a naming conflict is detected
  31.    1904         """
  32. -> 1905         if _is_opt_registered(self._opts, opt):
  33.   1906             return False
  34.   1907
  35.  
  36. /home/moguimar/.ve/oslo.config/lib/python2.7/site-packages/oslo_config/cfg.pyc in _is_opt_registered(opts, opt)
  37.    798     """
  38.     799     if opt.dest in opts:
  39. --> 800         if opts[opt.dest]['opt'] != opt:
  40.     801             raise DuplicateOptError(opt.name)
  41.     802         return True
  42.  
  43. /home/moguimar/.ve/oslo.config/lib/python2.7/site-packages/oslo_config/cfg.pyc in __ne__(self, another)
  44.    1049
  45.    1050     def __ne__(self, another):
  46. -> 1051         return self._vars_for_cmp() != another._vars_for_cmp()
  47.    1052
  48.    1053     def __eq__(self, another):
  49.  
  50. /home/moguimar/.ve/oslo.config/lib/python2.7/site-packages/oslo_config/types.pyc in __eq__(self, other)
  51.     900         return (
  52.     901             (self.__class__ == other.__class__) and
  53. --> 902             (self.value == other.value)
  54.     903         )
  55.     904
  56.  
  57. AttributeError: 'URI' object has no attribute 'value'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement