def body(self): request = cgi_request.readQuery() if request['name'] == 'local': path = os.path.abspath(request['path']) if not pathValid(path): raise Exception('The path you provided is invalid') return dict([(f, dict(ftype=getFType(os.path.join(path, f)), name=f)) for f in os.listdir(path)]) else: # # Forward the request onto the appropriate machine cluster = cluster_ws.loadCluster('localhost', request['name']) request['name'] = 'local' return cgi_request.performQuery(cluster['master']['public_dns'], URL, request)
def main(options, _args): cluster = loadCluster(options('general.host'), options('general.name')) runCommandOnCluster(cluster, options('general.command'), options('general.just_master'))