original_docstring: 
          This method is responsible of creating the image.
          
docstring: This method is responsible of creating the image.
docstring_tokens: This method is responsible of creating the image .
code: def create_image(self):
          """
          This method is responsible of creating the image.
          """
          self._shutdown_machine()
          self._destroy_machine()
          image_name = self.config['name']
          print(f'Creating image {image_name}')
          # delete image for this date if already existing
          if self.client.get_image(image_name):
              self.client.delete_image(image_name, wait=True, timeout=360)
  
          print('Waiting for volume to be available')
          for i in range(0, 360):
              status = self.client.get_volume(self.instance.volumes[0].id).status
              print("Status of volume is {}".format(status))
              if status == 'available':
                  break
              time.sleep(10)
  
          if status != 'available':
              raise RuntimeError('Volume was has not become available during the allowed'
                                 'time!')
  
          print('Creating image...')
          image = self.client.create_image(
              image_name,
              wait=True,
              timeout=3600,
              disk_format='raw',
              volume=self.instance.volumes[0].id
          )
  
          tags = self.config.get("tags", None)
          if tags:
              all_values = {}
              [all_values.update(tag) for tag in tags]
              self.client.update_image_properties(name_or_id=image.id, **all_values)
code_tokens: def create_image ( self ) : self . _shutdown_machine ( ) self . _destroy_machine ( ) image_name = self . config [ 'name' ] print ( f'Creating image {image_name}' ) if self . client . get_image ( image_name ) : self . client . delete_image ( image_name , wait = True , timeout = 360 ) print ( 'Waiting for volume to be available' ) for i in range ( 0 , 360 ) : status = self . client . get_volume ( self . instance . volumes [ 0 ] . id ) . status print ( "Status of volume is {}" . format ( status ) ) if status == 'available' : break time . sleep ( 10 ) if status != 'available' : raise RuntimeError ( 'Volume was has not become available during the allowed' 'time!' ) print ( 'Creating image...' ) image = self . client . create_image ( image_name , wait = True , timeout = 3600 , disk_format = 'raw' , volume = self . instance . volumes [ 0 ] . id ) tags = self . config . get ( "tags" , None ) if tags : all_values = { } [ all_values . update ( tag ) for tag in tags ] self . client . update_image_properties ( name_or_id = image . id , ** all_values )
short_docstring: This method is responsible of creating the image.
short_docstring_tokens: This method is responsible of creating the image .
comment: """
          This method is responsible of creating the image.
          """$SEP$# delete image for this date if already existing