本文整理汇总了Python中appscale.tools.appscale.AppScale.get_key_location方法的典型用法代码示例。如果您正苦于以下问题:Python AppScale.get_key_location方法的具体用法?Python AppScale.get_key_location怎么用?Python AppScale.get_key_location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appscale.tools.appscale.AppScale
的用法示例。
在下文中一共展示了AppScale.get_key_location方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTailWithIndexInBounds
# 需要导入模块: from appscale.tools.appscale import AppScale [as 别名]
# 或者: from appscale.tools.appscale.AppScale import get_key_location [as 别名]
def testTailWithIndexInBounds(self):
# calling 'appscale tail 1 *' should tail from the second node
# (nodes[1]). If there are two nodes in this deployment,
# we should tail from it successfully
appscale = AppScale()
contents = { 'keyname' : 'boo' }
yaml_dumped_contents = yaml.dump(contents)
one = {
'public_ip' : 'blarg'
}
two = {
'public_ip' : 'blarg2'
}
nodes = {'node_info': [one, two]}
nodes_contents = json.dumps(nodes)
mock = self.addMockForAppScalefile(appscale, yaml_dumped_contents)
(mock.should_receive('open')
.with_args(appscale.get_locations_json_file('boo'))
.and_return(flexmock(read=lambda: nodes_contents)))
flexmock(subprocess)
subprocess.should_receive('call').with_args(["ssh", "-o",
"StrictHostkeyChecking=no", "-i", appscale.get_key_location('boo'),
"[email protected]", "tail -F /var/log/appscale/c*"]).and_return().once()
appscale.tail(1, "c*")