本文整理匯總了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'])