本文整理汇总了Python中enarksh.DataLayer.DataLayer.enk_back_controller_init方法的典型用法代码示例。如果您正苦于以下问题:Python DataLayer.enk_back_controller_init方法的具体用法?Python DataLayer.enk_back_controller_init怎么用?Python DataLayer.enk_back_controller_init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enarksh.DataLayer.DataLayer
的用法示例。
在下文中一共展示了DataLayer.enk_back_controller_init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __startup
# 需要导入模块: from enarksh.DataLayer import DataLayer [as 别名]
# 或者: from enarksh.DataLayer.DataLayer import enk_back_controller_init [as 别名]
def __startup(self):
"""
Performs the necessary actions for starting the controller daemon.
"""
self.__log.info('Starting controller')
credentials = Credentials.get()
# Set database configuration options.
DataLayer.config['host'] = credentials.get_host()
DataLayer.config['user'] = credentials.get_user()
DataLayer.config['password'] = credentials.get_password()
DataLayer.config['database'] = credentials.get_database()
DataLayer.config['port'] = credentials.get_port()
DataLayer.config['autocommit'] = False
# Connect to the MySQL.
DataLayer.connect()
DataLayer.start_transaction()
# Sanitise the data in the database.
DataLayer.enk_back_controller_init()
# Create resources defined at host level.
self.__create_host_resources()
# Set the effective user and group to an unprivileged user and group.
self.__set_unprivileged_user()
# Commit transaction and close connection to MySQL.
DataLayer.commit()