I am a complete beginner with Python and fabric. I have the following code:
def initialise_clients( hostlist):
env.roledefs['clients']=hostlist
print hostlist
print("Setting up deployment: running on %d nodes \n" % len(hostlist))
create_jar()
def init_server(host):
env.roledefs['server'] = host
print "Initialising Server " + host
Instantiated as :
def start_experiment(nb_clients , nb_machines , nb_operations , trx_length , nb_reads , nb_writes ,
dataset , server_host , server_port , hostclients):
print("Running Experiment")
address = server_host + ':' + server_port
execute(init_server,address)
execute(initialise_clients,hostclients)
execute(create_server, server_port )
The create Server method is:
@roles('server')
def create_server( port):
print("Creating Server")
print env.host
print(port)
code_dir = '/net/work/evaluation/'
with lcd(code_dir):
run("java -jar server.jar " + port + " > log_server.txt ")
print("Server Initialised - Waiting for NFS to propagate ")
The problem that I have is this: when I execute the create_server task: I have this: [t] Executing task 'create_server' My guess is that it's a string problem due to my being new to python
Fatal error: Name lookup failed for t
Underlying exception: Name or service not known
Aborting.
which corresponds to the first character of the host I pass in (as a string 't...'). Why is this the case?
I call start_experiment with server_host defined as "name.server.org"