Browse Source

Merge "Close the http sessions of registry on image prepare" into stable/stein

tags/10.8.1
Zuul 3 weeks ago
parent
commit
8adc39b62d
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      tripleo_common/image/image_uploader.py

+ 5
- 0
tripleo_common/image/image_uploader.py View File

@@ -1091,6 +1091,7 @@ class PythonImageUploader(BaseImageUploader):
1091 1091
                     t.target_image, target_session):
1092 1092
                 LOG.warning('Skipping upload for modified image %s' %
1093 1093
                             t.target_image)
1094
+                target_session.close()
1094 1095
                 return []
1095 1096
             copy_target_url = t.target_image_source_tag_url
1096 1097
         else:
@@ -1170,6 +1171,9 @@ class PythonImageUploader(BaseImageUploader):
1170 1171
                         t.image_name)
1171 1172
         for layer in source_layers:
1172 1173
             self.image_layers.setdefault(layer, t.target_image_url)
1174
+
1175
+        target_session.close()
1176
+        source_session.close()
1173 1177
         return to_cleanup
1174 1178
 
1175 1179
     @classmethod
@@ -1877,6 +1881,7 @@ def discover_tag_from_inspect(args):
1877 1881
     session = self.authenticate(
1878 1882
         image_url, username=username, password=password)
1879 1883
     i = self._inspect(image_url, session=session)
1884
+    session.close()
1880 1885
     if ':' in image_url.path:
1881 1886
         # break out the tag from the url to be the fallback tag
1882 1887
         path = image.rpartition(':')

Loading…
Cancel
Save