docs: def do_repository_work(self,
  	                       repo_name,
  	                       repo_tag=None,
  	                       docker_executable='docker',
  	                       password=None,
  	                       force=None,
  	                       loglevel=logging.DEBUG,
  	                       note=None,
  	                       tag=None,
  	                       push=None,
  	                       export=None,
  	                       save=None):
  		"""Commit, tag, push, tar a docker container based on the configuration we have.
  
  		@param repo_name:           Name of the repository.
  		@param docker_executable:   Defaults to 'docker'
  		@param password:
  		@param force:
  
  		@type repo_name:            string
  		@type docker_executable:    string
  		@type password:             string
  		@type force:                boolean
  		"""
  		shutit_global.shutit_global_object.yield_to_draw()
  		# TODO: make host and client configurable
  		self.handle_note(note)
  		shutit_pexpect_session = self.get_current_shutit_pexpect_session()
  		if tag is None:
  			tag    = self.repository['tag']
  		if push is None:
  			push   = self.repository['push']
  		if export is None:
  			export = self.repository['export']
  		if save is None:
  			save   = self.repository['save']
  		if not (push or export or save or tag):
  			# If we're forcing this, then tag as a minimum
  			if force:
  				tag = True
  			else:
  				return True
  
  		shutit_pexpect_child = self.get_shutit_pexpect_session_from_id('host_child').pexpect_child
  		expect    = self.expect_prompts['ORIGIN_ENV']
  		server    = self.repository['server']
  		repo_user = self.repository['user']
  		if repo_tag is None:
  			repo_tag  = self.repository['tag_name']
  
  		if repo_user and repo_name:
  			repository = '%s/%s' % (repo_user, repo_name)
  			repository_tar = '%s%s' % (repo_user, repo_name)
  		elif repo_user:
  			repository = repository_tar = repo_user
  		elif repo_name:
  			repository = repository_tar = repo_name
  		else:
  			repository = repository_tar = ''
  
  		if not repository:
  			self.fail('Could not form valid repository name', shutit_pexpect_child=shutit_pexpect_child, throw_exception=False) # pragma: no cover
  		if (export or save) and not repository_tar:
  			self.fail('Could not form valid tar name', shutit_pexpect_child=shutit_pexpect_child, throw_exception=False) # pragma: no cover
  
  		if server != '':
  			repository = '%s/%s' % (server, repository)
  
  		if self.build['deps_only']:
  			repo_tag += '_deps'
  
  		if self.repository['suffix_date']:
  			suffix_date = time.strftime(self.repository['suffix_format'])
  			repository = '%s%s' % (repository, suffix_date)
  			repository_tar = '%s%s' % (repository_tar, suffix_date)
  
  		if repository != '' and len(repository.split(':')) > 1:
  			repository_with_tag = repository
  			repo_tag = repository.split(':')[1]
  		elif repository != '':
  			repository_with_tag = repository + ':' + repo_tag
  
  		# Commit image
  		# Only lower case accepted
  		repository          = repository.lower()
  		repository_with_tag = repository_with_tag.lower()
  
  		if server == '' and len(repository) > 30 and push:
  			self.fail("""repository name: '""" + repository + """' too long to push. If using suffix_date consider shortening, or consider adding "-s repository push no" to your arguments to prevent pushing.""", shutit_pexpect_child=shutit_pexpect_child, throw_exception=False) # pragma: no cover
  
  		if self.send(docker_executable + ' commit ' + self.target['container_id'] + ' ' + repository_with_tag,
  		             expect=[expect,' assword'],
  		             shutit_pexpect_child=shutit_pexpect_child,
  		             timeout=99999,
  		             check_exit=False,
  		             loglevel=loglevel) == 1:
  			self.send(self.host['password'],
  			          expect=expect,
  			          check_exit=False,
  			          record_command=False,
  			          shutit_pexpect_child=shutit_pexpect_child,
  			          echo=False,
  			          loglevel=loglevel)
  		# Tag image, force it by default
  		self.build['report'] += '\nBuild tagged as: ' + repository_with_tag
  		if export or save:
  			shutit_pexpect_session.pause_point('We are now exporting the container to a bzipped tar file, as configured in\n[repository]\ntar:yes', print_input=False, level=3)
  			if export:
  				bzfile = (repository_tar + 'export.tar.bz2')
  				self.log('Depositing bzip2 of exported container into ' + bzfile,level=logging.DEBUG)
  				if self.send(docker_executable + ' export ' + self.target['container_id'] + ' | bzip2 - > ' + bzfile,
  				             expect=[expect, 'assword'],
  				             timeout=99999,
  				             shutit_pexpect_child=shutit_pexpect_child,
  				             loglevel=loglevel) == 1:
  					self.send(password,
  					          expect=expect,
  					          shutit_pexpect_child=shutit_pexpect_child,
  					          loglevel=loglevel)
  				self.log('Deposited bzip2 of exported container into ' + bzfile, level=loglevel)
  				self.log('Run: bunzip2 -c ' + bzfile + ' | sudo docker import - to get this imported into docker.', level=logging.DEBUG)
  				self.build['report'] += ('\nDeposited bzip2 of exported container into ' + bzfile)
  				self.build['report'] += ('\nRun:\n\nbunzip2 -c ' + bzfile + ' | sudo docker import -\n\nto get this imported into docker.')
  			if save:
  				bzfile = (repository_tar + 'save.tar.bz2')
  				self.log('Depositing bzip2 of exported container into ' + bzfile,level=logging.DEBUG)
  				if self.send(docker_executable + ' save ' + self.target['container_id'] + ' | bzip2 - > ' + bzfile,
  				             expect=[expect, 'assword'],
  				             timeout=99999,
  				             shutit_pexpect_child=shutit_pexpect_child,
  				             loglevel=loglevel) == 1:
  					self.send(password,
  					          expect=expect,
  					          shutit_pexpect_child=shutit_pexpect_child,
  					          loglevel=loglevel)
  				self.log('Deposited bzip2 of exported container into ' + bzfile, level=logging.DEBUG)
  				self.log('Run: bunzip2 -c ' + bzfile + ' | sudo docker import - to get this imported into docker.', level=logging.DEBUG)
  				self.build['report'] += ('\nDeposited bzip2 of exported container into ' + bzfile)
  				self.build['report'] += ('\nRun:\n\nbunzip2 -c ' + bzfile + ' | sudo docker import -\n\nto get this imported into docker.')
  		if self.repository['push']:
  			# Pass the child explicitly as it's the host child.
  			self.push_repository(repository, docker_executable=docker_executable, expect=expect, shutit_pexpect_child=shutit_pexpect_child)
  			self.build['report'] = (self.build['report'] + '\nPushed repository: ' + repository)
  		self.handle_note_after(note)
  		return True