Esempio n. 1
0
def main():
	sys.stdout = synctool_unbuffered.Unbuffered(sys.stdout)
	sys.stderr = synctool_unbuffered.Unbuffered(sys.stderr)
	
	get_options()
	
	if OPT_AGGREGATE:
		synctool_aggr.run(MASTER_OPTS)
		sys.exit(0)
	
	synctool_config.add_myhostname()
	
	# ooh ... testing for DRY_RUN doesn't work here
#	if '-f' in PASS_ARGS or '--fix' in PASS_ARGS:
#		synctool_lib.openlog()
	
	nodes = NODESET.interfaces()
	if nodes == None or len(nodes) <= 0:
		print 'no valid nodes specified'
		sys.exit(1)
	
	local_interface = synctool_config.get_node_interface(synctool_param.NODENAME)
	
	for node in nodes:
		#
		#	is this node the localhost? then run locally
		#
		if node == local_interface:
			run_local_pkg()
			nodes.remove(node)
			break
	
	run_remote_pkg(nodes)
Esempio n. 2
0
def main():
	sys.stdout = synctool_unbuffered.Unbuffered(sys.stdout)
	sys.stderr = synctool_unbuffered.Unbuffered(sys.stderr)

	(upload_filename, upload_suffix) = get_options()

	if OPT_CHECK_UPDATE:
		import synctool_update
		sys.exit(synctool_update.check())

	if OPT_DOWNLOAD:
		import synctool_update
		sys.exit(synctool_update.download())

	if OPT_AGGREGATE:
		synctool_aggr.run(MASTER_OPTS)
		sys.exit(0)

	synctool_config.add_myhostname()

	# ooh ... testing for DRY_RUN doesn't work here
	if '-f' in PASS_ARGS or '--fix' in PASS_ARGS:
		synctool_lib.openlog()

	nodes = NODESET.interfaces()
	if nodes == None or len(nodes) <= 0:
		print 'no valid nodes specified'
		sys.exit(1)

	if upload_filename:			# upload a file
		if len(nodes) != 1:
			print "The option --upload can only be run on just one node"
			print "Please use --node=nodename to specify the node to upload from"
			sys.exit(1)
		
		upload(nodes[0], upload_filename, upload_suffix)

	else:						# do regular synctool run
		local_interface = synctool_config.get_node_interface(synctool_param.NODENAME)

		for node in nodes:
			#
			#	is this node the localhost? then run locally
			#
			if node == local_interface:
				run_local_synctool()
				nodes.remove(node)
				break

		run_remote_synctool(nodes)

	synctool_lib.closelog()
Esempio n. 3
0
def main():
	sys.stdout = synctool_unbuffered.Unbuffered(sys.stdout)
	sys.stderr = synctool_unbuffered.Unbuffered(sys.stderr)
	
	cmd_args = get_options()
	
	if OPT_AGGREGATE:
		synctool_aggr.run(MASTER_OPTS)
		sys.exit(0)
	
	synctool_config.add_myhostname()
	
	run_dsh(cmd_args)
Esempio n. 4
0
def main():
	sys.stdout = synctool_unbuffered.Unbuffered(sys.stdout)
	sys.stderr = synctool_unbuffered.Unbuffered(sys.stderr)
	
	cmd_args = get_options()
	
	if OPT_AGGREGATE:
		synctool_aggr.run(MASTER_OPTS)
		sys.exit(0)
	
	synctool_config.add_myhostname()
	
	nodes = NODESET.interfaces()
	if nodes == None or len(nodes) <= 0:
		print 'no valid nodes specified'
		sys.exit(1)
	
	ping_nodes(nodes)