cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
710
Views
5
Helpful
2
Replies
Highlighted
Beginner

CAT9K_IOSXE Guestshell ZTP - Python / cmd can not execute in non-interactive context

Hello,

I am trying to install a cat9k_iosxe.16.06.03.SPA.bin image with guestshell (ZTP - Python),
I have this message:
"% Interactive command can not execute in non-interactive context"

 

! here is the command:
install_cmd = "request platform software package install switch all flash: cat9k_iosxe.16.06.03.SPA.bin auto-copy"

cli.executep (install_cmd)

 

Nota: The execution of the command in privileged EXEC mode is correctly executed and without confirmation message (non interactive)

 

Thank you for your help.

Everyone's tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Cisco Employee

Re: CAT9K_IOSXE Guestshell ZTP - Python / cmd can not execute in non-interactive context

Even if the command does not prompt, it may be marked interactive.  I'd generally consider that a bug.  To workaround this, you can use EEM to wrap the command:

 

event manager applet upgrade

 event none maxrun 300

 action 1.0 cli command "enable"

 action 2.0 cli command "request platform software package install switch all flash: cat9k_iosxe.16.06.03.SPA.bin auto-copy"

 

Then:

 

install_cmd = "event manager run upgrade"

2 REPLIES 2
Hall of Fame Cisco Employee

Re: CAT9K_IOSXE Guestshell ZTP - Python / cmd can not execute in non-interactive context

Even if the command does not prompt, it may be marked interactive.  I'd generally consider that a bug.  To workaround this, you can use EEM to wrap the command:

 

event manager applet upgrade

 event none maxrun 300

 action 1.0 cli command "enable"

 action 2.0 cli command "request platform software package install switch all flash: cat9k_iosxe.16.06.03.SPA.bin auto-copy"

 

Then:

 

install_cmd = "event manager run upgrade"

Beginner

Re: CAT9K_IOSXE Guestshell ZTP - Python / cmd can not execute in non-interactive context

Hi, it works with EEM, thank you Joe

Nota : install_cmd = ....switch all FILE flash:......

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards