[Python] Replace Tokens - 'init' not found - name not supplied

Discussão em 'Python' iniciado por Stack, Setembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    I need to replace a particular file tokens, so I have set the sources to

    src/some_folder/somes_cript.py


    As the pipeline is launched, the template is called and ran properly

    but I get these errors:

    token pattern '__\s*((?:(?!__)(?!\s*__).)*)\s*__'
    transform pattern '\s*(.*)\(\s*((?:(?!\()(?!\s*\)).)*)\s*\)\s*'
    replacing tokens in '/home/someuser/agent/_work/8/s/src/some_folder/somes_cript.py'
    encoding 'ascii'
    ##[error]variable 'init' not found
    init:
    ##[error]Error: name not supplied


    This is my pipeline template :

    parameters:
    - name: targetDirectory
    type: string
    default: '$(System.DefaultWorkingDirectory)'

    steps:
    - task: qetza.replacetokens.replacetokens-task.replacetokens@6
    name: replace_tokens
    displayName: "Inject secrets"
    inputs:
    root: "${{ parameters.targetDirectory }}"
    sources: |
    **/src/some_folder/somes_cript.py
    tokenPattern: 'doubleunderscores'
    logLevel: 'debug'
    missingVarLog: 'error'


    Thanks for your help

    Continue reading...

Compartilhe esta Página