components/openstack/glance/patches/05-launchpad-1255556.patch
branchs11u2-sru
changeset 4156 4b1def16fe9b
parent 4146 097063f324c0
child 4157 92532a6159e7
equal deleted inserted replaced
4146:097063f324c0 4156:4b1def16fe9b
     1 Although the following patch has been addressed in Icehouse 2014.1, it
       
     2 still has not yet been released for Havana.  It has been modified to
       
     3 apply cleanly into our current Havana implementation
       
     4 
       
     5 commit 1f6381a73f5c99f1f731d6c4f9defb91bd2d042d
       
     6 Author: Flavio Percoco <[email protected]>
       
     7 Date:   Thu Nov 28 16:17:13 2013 +0100
       
     8 
       
     9     Don't enable all stores by default
       
    10     
       
    11     Glance currently enables all stores by default. This patch changes that
       
    12     by removing all stores that require manual configuration and leaving
       
    13     those that work right out of the box.
       
    14     
       
    15     Current behavior causes a lot of confusion to users since most of those
       
    16     stores print errors when they're not configured correctly. All extra
       
    17     stores should be enabled explicitly by users.
       
    18     
       
    19     This fix makes tests use http locations. All other locations besides the
       
    20     default ones should be tested in their own test suites.
       
    21     
       
    22     DocImpact
       
    23     Closes-bug: #1255556
       
    24     Change-Id: I82073352641d3eb2ab3d6e9a6b64afc99a30dcc7
       
    25 
       
    26 --- glance-2013.2.3/etc/glance-api.conf.~1~	2014-04-03 11:43:55.000000000 -0700
       
    27 +++ glance-2013.2.3/etc/glance-api.conf	2014-05-29 13:47:44.689586507 -0700
       
    28 @@ -13,13 +13,14 @@
       
    29  
       
    30  # List of which store classes and store class locations are
       
    31  # currently known to glance at startup.
       
    32 +# Existing but disabled stores:
       
    33 +#      glance.store.rbd.Store,
       
    34 +#      glance.store.s3.Store,
       
    35 +#      glance.store.swift.Store,
       
    36 +#      glance.store.sheepdog.Store,
       
    37 +#      glance.store.cinder.Store,
       
    38  #known_stores = glance.store.filesystem.Store,
       
    39 -#               glance.store.http.Store,
       
    40 -#               glance.store.rbd.Store,
       
    41 -#               glance.store.s3.Store,
       
    42 -#               glance.store.swift.Store,
       
    43 -#               glance.store.sheepdog.Store,
       
    44 -#               glance.store.cinder.Store,
       
    45 +#               glance.store.http.Store
       
    46  
       
    47  
       
    48  # Maximum image size (in bytes) that may be uploaded through the
       
    49 --- glance-2013.2.3/glance/store/__init__.py.~1~	2014-04-03 11:43:55.000000000 -0700
       
    50 +++ glance-2013.2.3/glance/store/__init__.py	2014-05-29 13:53:14.827604452 -0700
       
    51 @@ -38,12 +38,7 @@
       
    52      cfg.ListOpt('known_stores',
       
    53                  default=[
       
    54                      'glance.store.filesystem.Store',
       
    55 -                    'glance.store.http.Store',
       
    56 -                    'glance.store.rbd.Store',
       
    57 -                    'glance.store.s3.Store',
       
    58 -                    'glance.store.swift.Store',
       
    59 -                    'glance.store.sheepdog.Store',
       
    60 -                    'glance.store.cinder.Store',
       
    61 +                    'glance.store.http.Store'
       
    62                  ],
       
    63                  help=_('List of which store classes and store class locations '
       
    64                         'are currently known to glance at startup.')),
       
    65 --- glance-2013.2.3/glance/tests/unit/test_s3_store.py.~1~	2014-04-03 11:43:55.000000000 -0700
       
    66 +++ glance-2013.2.3/glance/tests/unit/test_s3_store.py	2014-05-29 13:43:01.104336073 -0700
       
    67 @@ -41,7 +41,8 @@
       
    68             's3_store_access_key': 'user',
       
    69             's3_store_secret_key': 'key',
       
    70             's3_store_host': 'localhost:8080',
       
    71 -           's3_store_bucket': 'glance'}
       
    72 +           's3_store_bucket': 'glance',
       
    73 +           'known_stores': ['glance.store.s3.Store']}
       
    74  
       
    75  
       
    76  # We stub out as little as possible to ensure that the code paths
       
    77 --- glance-2013.2.3/glance/tests/unit/test_store_image.py.~1~	2014-04-03 11:43:55.000000000 -0700
       
    78 +++ glance-2013.2.3/glance/tests/unit/test_store_image.py	2014-05-29 13:43:01.104846210 -0700
       
    79 @@ -20,7 +20,7 @@
       
    80  from glance.tests import utils
       
    81  
       
    82  
       
    83 -BASE_URI = 'swift+http://storeurl.com/container'
       
    84 +BASE_URI = 'http://storeurl.com/container'
       
    85  UUID1 = 'c80a1a6c-bd1f-41c5-90ee-81afedb1d58d'
       
    86  UUID2 = '971ec09a-8067-4bc8-a91f-ae3557f1c4c7'
       
    87  USER1 = '54492ba0-f4df-4e4e-be62-27f4d76b29cf'
       
    88 --- glance-2013.2.3/glance/tests/unit/test_store_location.py.~2~	2014-05-29 13:43:01.087604346 -0700
       
    89 +++ glance-2013.2.3/glance/tests/unit/test_store_location.py	2014-05-29 15:38:15.306762870 -0700
       
    90 @@ -30,6 +30,18 @@
       
    91  
       
    92      def setUp(self):
       
    93          self.config(default_store='file')
       
    94 +
       
    95 +        # NOTE(flaper87): Each store should test
       
    96 +        # this in their test suite.
       
    97 +        self.config(known_stores=[
       
    98 +            "glance.store.filesystem.Store",
       
    99 +            "glance.store.http.Store",
       
   100 +            "glance.store.rbd.Store",
       
   101 +            "glance.store.s3.Store",
       
   102 +            "glance.store.swift.Store",
       
   103 +            "glance.store.sheepdog.Store",
       
   104 +            "glance.store.cinder.Store",
       
   105 +        ])
       
   106          super(TestStoreLocation, self).setUp()
       
   107  
       
   108      def test_get_location_from_uri_back_to_uri(self):
       
   109 --- glance-2013.2.3/glance/tests/unit/utils.py.~1~	2014-04-03 11:43:55.000000000 -0700
       
   110 +++ glance-2013.2.3/glance/tests/unit/utils.py	2014-05-29 13:43:01.105795472 -0700
       
   111 @@ -36,7 +36,7 @@
       
   112  USER2 = '0b3b3006-cb76-4517-ae32-51397e22c754'
       
   113  USER3 = '2hss8dkl-d8jh-88yd-uhs9-879sdjsd8skd'
       
   114  
       
   115 -BASE_URI = 'swift+http://storeurl.com/container'
       
   116 +BASE_URI = 'http://storeurl.com/container'
       
   117  
       
   118  
       
   119  def get_fake_request(path='', method='POST', is_admin=False, user=USER1,