From d6c4017a2ededd8b5bf37018140adb9814285c91 Mon Sep 17 00:00:00 2001 From: kikiyou <906852379@qq.com> Date: Mon, 6 Jun 2016 21:55:54 -0500 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=A4=BA=E4=BE=8B=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E8=BF=90=E8=A1=8C=20(#237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为了安全pattern=空,后示例代码无法使用,运行示例时加上pattern='*',使示例可以返回正确的结果 --- jperm/ansible_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jperm/ansible_api.py b/jperm/ansible_api.py index 20725908c..02d65907e 100644 --- a/jperm/ansible_api.py +++ b/jperm/ansible_api.py @@ -493,8 +493,8 @@ if __name__ == "__main__": # # "ansible_become_user": "root", # "ansible_become_pass": "yusky0902", }] - cmd = Command(resource) - print cmd.run('ls') + cmd.run('ls',pattern='*') + print cmd.results_raw # resource = [{"hostname": "192.168.10.148", "port": "22", "username": "root", "password": "xxx"}] # task = Tasks(resource)