11684: Reverted easy fix to expose the bug: when there's a delay writing a block...
[arvados.git] / sdk / python / arvados / commands / keepdocker.py
index 0c491389ab6bc438b6ccfc48903430ef528a8049..22ea4760c94cfb421014085b4ad453bab0be8d0a 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 from builtins import next
 import argparse
 import collections
@@ -99,7 +97,7 @@ def docker_image_format(image_hash):
     cmd = popen_docker(['inspect', '--format={{.Id}}', image_hash],
                         stdout=subprocess.PIPE)
     try:
-        image_id = next(cmd.stdout).strip()
+        image_id = next(cmd.stdout).decode().strip()
         if image_id.startswith('sha256:'):
             return 'v2'
         elif ':' not in image_id:
@@ -112,7 +110,7 @@ def docker_image_format(image_hash):
 def docker_image_compatible(api, image_hash):
     supported = api._rootDesc.get('dockerImageFormats', [])
     if not supported:
-        logger.warn("server does not specify supported image formats (see docker_image_formats in server config).")
+        logger.warning("server does not specify supported image formats (see docker_image_formats in server config).")
         return False
 
     fmt = docker_image_format(image_hash)
@@ -369,7 +367,7 @@ def main(arguments=None, stdout=sys.stdout):
 
     if not docker_image_compatible(api, image_hash):
         if args.force_image_format:
-            logger.warn("forcing incompatible image")
+            logger.warning("forcing incompatible image")
         else:
             logger.error("refusing to store " \
                 "incompatible format (use --force-image-format to override)")