Ich benutze Pexpect, um eine Wacholder-Firewall einzuloggen und den gleichen Befehl zweimal zu senden, ich erwarte, dass die Ausgabe (ich meine s.before
) sollte gleich sein, aber sie sind nicht. Warum verhält sich Pexpect auf demselben Befehl anders?pexpect verhält sich bei gleicher Eingabe anders
Unten ist die Python-Testdatei.
Unten ist die Stdout-Ausgabe, die ich sehen kann, der gleiche Löschbefehl gibt unterschiedliche Antwort zurück.
cli
configure
Entering configuration mode
Users currently editing the configuration:
root terminal p1 (pid 64918) on since 2017-11-02 15:18:07 UTC, idle 01:34:05
[edit]
root terminal p0 (pid 64649) on since 2017-11-02 14:38:45 UTC, idle 02:07:38
[edit]
root terminal p4 (pid 64737) on since 2017-11-02 14:56:05 UTC, idle 01:55:21
[edit]
The configuration has been changed but not committed
[edit]
start---------------------------------------------
delete interfaces ge-0/0/5 unit 0 family inet addres
end---------------------------------------------
start---------------------------------------------
...0/5 unit 0 family inet address 10.123.0.13/32
delete interfaces ge-0/0/5 unit 0 family inet address 10.123.0.13/32warning: statement not found
[edit]
end---------------------------------------------
Unten ist die manuelle Bedienung auf Wacholderfirewall, die die gleichen auf die zwei Löschbefehle reagieren.
[[email protected] ~]$ ssh [email protected]
--- JUNOS 12.1X44-D35.5 built 2014-05-19 21:36:43 UTC
[email protected]% cli
[email protected]> configure
Entering configuration mode
Users currently editing the configuration:
root terminal p1 (pid 64918) on since 2017-11-02 15:18:07 UTC, idle 01:37:27
[edit]
root terminal p4 (pid 64737) on since 2017-11-02 14:56:05 UTC, idle 01:58:43
[edit]
The configuration has been changed but not committed
[edit]
[email protected]# delete interfaces ge-0/0/5 unit 0 family inet address 10.123.0.13/32
warning: statement not found
[edit]
[email protected]# delete interfaces ge-0/0/5 unit 0 family inet address 10.123.0.13/32
warning: statement not found
[edit]
[email protected]#