def zk_service_name(ip_address, keyname):
 key_file = '{}/{}.key'.format(KEY_DIRECTORY, keyname)
 ssh_cmd = ['ssh', '-i', key_file, ip_address, 'ls {}'.format(SERVICES_DIR)]
 response = subprocess.check_output(ssh_cmd)
 init_files = response.split()
 for init_file in init_files:
  if ('zookeeper' in init_file):
   return init_file
 raise OSError('Unable to find ZooKeeper on {}'.format(ip_address))

def zk_service_name ( ip_address , keyname ) : key_file = '{}/{}.key' . format ( KEY_DIRECTORY , keyname ) ssh_cmd = [ 'ssh' , '-i' , key_file , ip_address , 'ls {}' . format ( SERVICES_DIR ) ] response = subprocess . check_output ( ssh_cmd ) init_files = response . split ( ) for init_file in init_files : if ( 'zookeeper' in init_file ) : return init_file raise OSError ( 'Unable to find ZooKeeper on {}' . format ( ip_address ) )
fetches the name of the zookeeper service on a given machine .