From 8f9badb2b49b6c8a7105ca674b80aab3f16773ea Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 8 Feb 2016 08:12:09 -0500 Subject: [PATCH] update shared module junos to handle root logins --- lib/ansible/module_utils/junos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index 33af9266e7..4912d008ff 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -77,7 +77,8 @@ class NetworkModule(AnsibleModule): def connect(self): self.connection = Cli(self) self.connection.connect() - self.execute('cli') + if self.connection.shell._matched_prompt.strip().endswith('%'): + self.execute('cli') self.execute('set cli screen-length 0') def configure(self, commands):