本文整理汇总了Python中stitches.expect.Expect.ping_pong方法的典型用法代码示例。如果您正苦于以下问题:Python Expect.ping_pong方法的具体用法?Python Expect.ping_pong怎么用?Python Expect.ping_pong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stitches.expect.Expect
的用法示例。
在下文中一共展示了Expect.ping_pong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: install_rpm_from_rhua
# 需要导入模块: from stitches.expect import Expect [as 别名]
# 或者: from stitches.expect.Expect import ping_pong [as 别名]
def install_rpm_from_rhua(rhua_connection, connection, rpmpath):
'''
Transfer RPM package from RHUA host to the instance and install it
@param rpmpath: path to RPM package on RHUA node
'''
tfile = tempfile.NamedTemporaryFile(delete=False)
tfile.close()
rhua_connection.sftp.get(rpmpath, tfile.name)
connection.sftp.put(tfile.name, tfile.name + ".rpm")
os.unlink(tfile.name)
Expect.ping_pong(connection, "rpm -i " + tfile.name + ".rpm" + " && echo SUCCESS", "[^ ]SUCCESS", 60)