docs: def print_config(self, cfg, hide_password=True, history=False, module_id=None):
  		"""Returns a string representing the config of this ShutIt run.
  		"""
  		shutit_global.shutit_global_object.yield_to_draw()
  		cp = self.config_parser
  		s = ''
  		keys1 = list(cfg.keys())
  		if keys1:
  			keys1.sort()
  		for k in keys1:
  			if module_id is not None and k != module_id:
  				continue
  			if isinstance(k, str) and isinstance(cfg[k], dict):
  				s += '\n[' + k + ']\n'
  				keys2 = list(cfg[k].keys())
  				if keys2:
  					keys2.sort()
  				for k1 in keys2:
  					line = ''
  					line += k1 + ':'
  					# If we want to hide passwords, we do so using a sha512
  					# done an aritrary number of times (27).
  					if hide_password and (k1 == 'password' or k1 == 'passphrase'):
  						p = hashlib.sha512(cfg[k][k1]).hexdigest()
  						i = 27
  						while i > 0:
  							i -= 1
  							p = hashlib.sha512(s).hexdigest()
  						line += p
  					else:
  						if type(cfg[k][k1] == bool):
  							line += str(cfg[k][k1])
  						elif type(cfg[k][k1] == str):
  							line += cfg[k][k1]
  					if history:
  						try:
  							line += (30-len(line)) * ' ' + ' # ' + cp.whereset(k, k1)
  						except Exception:
  							# Assume this is because it was never set by a config parser.
  							line += (30-len(line)) * ' ' + ' # ' + "defaults in code"
  					s += line + '\n'
  		return s