#!/usr/bin/env python
# Copyright (c) 2009 Arastra, Inc.  All rights reserved.
# Arastra, Inc. Confidential and Proprietary.

# Return the list if library paths generated at build time
# pylint: disable-msg=F0401

import os, Tac, sys

cppLibList = "/etc/ProcMgr.d/fastLoadLibList.cpp.txt"
libListFile = "/etc/ProcMgr.d/fastLoadLibList.py.txt"  # assume python

if len( sys.argv ) > 1: # load c++ libraries
   libListFile = cppLibList

# Files should have been created at build time, just cat them
if os.path.isfile( libListFile ):
   libList = Tac.run( [ "/bin/cat", libListFile ], stdout=Tac.CAPTURE )
   print libList

# make sure the output generated is flushed before we call exit ahead.
sys.stdout.flush()

# This script is run on boot and may print garbage when exiting
# see BUG24457, so we do a hard exit.
os._exit( 0 )

