#!/usr/bin/env python3
# Copyright (c) 2017 Arista Networks, Inc.  All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
import ConfigAgent # pylint: disable=import-self
import Tac
import Plugins

# Import python code early, so ConfigAgent can start doing some work in parallel with
# Sysdb (all agents will wait for Sysdb). This is competing a bit with the preloaders
# (see EosInit/EosPreloadPy), but adds extra benefits on top of preloading since it
# actually imports the code. Importing the plugins takes a while, so set the title
# right now, so under test conditions those cpu cycles can be accounted towards CA.
# There is a small benefit to RTLD_LAZY, so we enable that as well.
Tac.Value( "Tac::System" ).dlopenLazyIs( True )
Tac.setproctitle( "ConfigAgent" )
Plugins.loadPlugins( "CliPlugin", callPluginFn=False )

ConfigAgent.main() # pylint: disable=c-extension-no-member

