CiscoTestAutomation / pyats

Cisco DevNet pyATS Test Framework Bug Tracker
Apache License 2.0
148 stars 31 forks source link

Fail Copy_To_Device cleaner via FTP on iOS XR #229

Closed widadzakaria closed 6 months ago

widadzakaria commented 6 months ago

Hi,

When I try to copy a file from a Server to an iOS XR router (ASR9K) using the copy_to_device cleaner and the FTP protocole, the command executed in the CLI has this format : copy ftp://[Username]:[Password]@[Server-IP]//[File_Directory] [Destination_Directory_on_Router] .

The problem is that the router ask again the : Address or name of remote host, Source Username, Source password, Destination FIlename... so the new format 'generated' by the router add again the username and the password... So the command become : ftp://[Username]:*@[Server-IP]/%2F[Username]:[Password]@[Server-IP]//[File_Directory] [Destination_Directory_on_Router]. So the copy fails with this error : %GENIE-ERROR: ('Command execution failed', SubCommandFailure('sub_command failure, patterns matched in the output:'.....

Actually, the command that has to be executed on an iOS XR router has to be : copy ftp://[Server-IP]//[File_Directory] [Destination_Directory_on_Router], so when the router ask for the username and password, the command that it generates is the good one .

Here is an example of the clean.yaml:

cleaners:
    PyatsDeviceClean:
        module: genie.libs.clean
        devices: [R1]

devices:
    R1:
        connect:

        copy_to_device:
            origin:
                hostname: Server
                files:
                    - [File_Directory] 
            destination:
                [Destination_Directory_on_Router]
            protocol: ftp #it works using tftp
        order:
        - connect
        - copy_to_device

Thanks for the help :)

widadzakaria commented 6 months ago

Copy of : https://github.com/CiscoTestAutomation/genieparser/issues/819

SohanTirpude commented 6 months ago

Hello @widadzakaria,

I will closing this ticket as you have created a duplicate one here: https://github.com/CiscoTestAutomation/genielibs/issues/152

Kindly do not create duplicate tickets.

Thank you.