def copy_to_machine(machine_name, module_id, config):
	""" Function: Move a module installer files to a remote mahine from local location
	""" 
	remote_location = config.find_location_on_remote_machine(module_id, machine_name)
	local_module_location = config.find_location_for_module(module_id, 'stage_location')
	logger.info( "[" + module_id + "] Copying from " + local_module_location + " to " + remote_location)
	
	try:
		if os.path.isdir(remote_location):
			shutil.rmtree(remote_location, True )
	except:
		logger.error("[" + module_id + "] Failed to remove:" + remote_location + "on machine " + machine_name)
		logger.error("[" + module_id + "] Failed to remove Error:" + str(sys.exc_info()[0])+ " " + str(sys.exc_info()[1]))
	
	try:
		shutil.copytree(local_module_location, remote_location)
	except:
		logger.info("FAILURE: Copy of module " + module_id + "Failed on machine " + machine_name )
		logger.error("[" + module_id + "] Failed to copy:" + remote_location)
		logger.error("[" + module_id + "] Failed to copy Error:" + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
 Function: Move a module installer files to a remote mahine from local location
	
recipes/Python/302592_Threaded_FTP_Client/recipe-302592.py