本文整理汇总了Python中ambari_agent.ActionQueue.ActionQueue.installAndConfigAction方法的典型用法代码示例。如果您正苦于以下问题:Python ActionQueue.installAndConfigAction方法的具体用法?Python ActionQueue.installAndConfigAction怎么用?Python ActionQueue.installAndConfigAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ambari_agent.ActionQueue.ActionQueue
的用法示例。
在下文中一共展示了ActionQueue.installAndConfigAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_installAndConfigAction
# 需要导入模块: from ambari_agent.ActionQueue import ActionQueue [as 别名]
# 或者: from ambari_agent.ActionQueue.ActionQueue import installAndConfigAction [as 别名]
def test_installAndConfigAction(self):
action={'id' : 'tttt'}
actionQueue = ActionQueue(AmbariConfig().getConfig())
path = actionQueue.getInstallFilename(action['id'])
configFile = {
"data" : "test",
"owner" : os.getuid(),
"group" : os.getgid() ,
"permission" : 0700,
"path" : path,
"umask" : 022
}
#note that the command in the action is just a listing of the path created
#we just want to ensure that 'ls' can run on the data file (in the actual world
#this 'ls' would be a puppet or a chef command that would work on a data
#file
path=getFilePath(action,path)
action = {
'id' : 'tttt',
'kind' : 'INSTALL_AND_CONFIG_ACTION',
'workDirComponent' : 'abc-hdfs',
'file' : configFile,
'clusterDefinitionRevision' : 12,
'command' : ['/bin/ls',path]
}
result = { }
actionQueue = ActionQueue(AmbariConfig().getConfig())
result = actionQueue.installAndConfigAction(action)
cmdResult = result['commandResult']
self.assertEqual(cmdResult['exitCode'], 0, "installAndConfigAction test failed. Returned %d " % cmdResult['exitCode'])
self.assertEqual(cmdResult['output'], path + "\n", "installAndConfigAction test failed Returned %s " % cmdResult['output'])