
from tests.bare_image_provider import TagBareImageProvider
from tests.product.constants import BASE_IMAGES_TAG
from tests.product.constants import BASE_IMAGE_NAME


class NoHadoopBareImageProvider(TagBareImageProvider):
    def __init__(self):
        super(NoHadoopBareImageProvider, self).__init__(
            BASE_IMAGE_NAME, BASE_IMAGE_NAME,
            BASE_IMAGES_TAG, 'nohadoop')


import re

from tests.bare_image_provider import TagBareImageProvider
from tests.product.constants import BASE_IMAGES_TAG
from tests.product.constants import BASE_IMAGE_NAME


class NoHadoopBareImageProvider(TagBareImageProvider):
    def __init__(self):
        # encode base image name into name of created test image, to prevent image name clash.
        decoration = 'nohadoop_' + re.sub(r"[^A-Za-z0-9]", "_", BASE_IMAGE_NAME)
        super(NoHadoopBareImageProvider, self).__init__(
            BASE_IMAGE_NAME, BASE_IMAGE_NAME,
            BASE_IMAGES_TAG, decoration)

Use bare image name dependent on base image name
Use bare image name dependent on base image name

+ 
+ import re
  
  from tests.bare_image_provider import TagBareImageProvider
  from tests.product.constants import BASE_IMAGES_TAG
  from tests.product.constants import BASE_IMAGE_NAME
  
  
  class NoHadoopBareImageProvider(TagBareImageProvider):
      def __init__(self):
+         # encode base image name into name of created test image, to prevent image name clash.
+         decoration = 'nohadoop_' + re.sub(r"[^A-Za-z0-9]", "_", BASE_IMAGE_NAME)
          super(NoHadoopBareImageProvider, self).__init__(
              BASE_IMAGE_NAME, BASE_IMAGE_NAME,
-             BASE_IMAGES_TAG, 'nohadoop')
+             BASE_IMAGES_TAG, decoration)
  
Use bare image name dependent on base image name
## Code Before:

from tests.bare_image_provider import TagBareImageProvider
from tests.product.constants import BASE_IMAGES_TAG
from tests.product.constants import BASE_IMAGE_NAME


class NoHadoopBareImageProvider(TagBareImageProvider):
    def __init__(self):
        super(NoHadoopBareImageProvider, self).__init__(
            BASE_IMAGE_NAME, BASE_IMAGE_NAME,
            BASE_IMAGES_TAG, 'nohadoop')

## Instruction:
Use bare image name dependent on base image name
## Code After:

import re

from tests.bare_image_provider import TagBareImageProvider
from tests.product.constants import BASE_IMAGES_TAG
from tests.product.constants import BASE_IMAGE_NAME


class NoHadoopBareImageProvider(TagBareImageProvider):
    def __init__(self):
        # encode base image name into name of created test image, to prevent image name clash.
        decoration = 'nohadoop_' + re.sub(r"[^A-Za-z0-9]", "_", BASE_IMAGE_NAME)
        super(NoHadoopBareImageProvider, self).__init__(
            BASE_IMAGE_NAME, BASE_IMAGE_NAME,
            BASE_IMAGES_TAG, decoration)
