Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trim to register_runner_cmd #281

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Conversation

alexanderfast
Copy link
Contributor

Using version 1.6.54. Upgrading to latest didnt work out of the box (will look into that later).

When using the role, the variable used on the two changed lines contains a newline character. Which breaks the runner registration. Calling trim like so fixes it. But Im curious why no one else has run across this, feels like it should never work or work all the time.

$ pipenv requirements
-i https://pypi.org/simple
ansible==8.3.0
ansible-core==2.15.3 ; python_version >= '3.9'
cffi==1.15.1
cryptography==41.0.3 ; python_version >= '3.7'
importlib-resources==5.0.7 ; python_version < '3.10'
jinja2==3.1.2 ; python_version >= '3.7'
jmespath==1.0.1
markupsafe==2.1.3 ; python_version >= '3.7'
packaging==23.1 ; python_version >= '3.7'
pycparser==2.21
pyyaml==6.0.1 ; python_version >= '3.6'
resolvelib==1.0.1

@guenhter
Copy link
Collaborator

Do you know where the newline comes from in the register_runner_cmd?
I'm asking because the cmd is defined as

register_runner_cmd: >-

which is the yaml syntax for: Replace newlines with spaces and no newline at the end (https://yaml-multiline.info/ :))

@alexanderfast
Copy link
Contributor Author

It looks to be at the very end. Or it's somehow introduced when the variable is used. I cant find a place where its altered in between. I was thinking that maybe one of the variable values we use had a newline in it, but if that yaml syntax is supposed to remove then I dont know.

Could the pyyaml version have a bug in it in the latest version? What version do you use when you test this?

@alexanderfast
Copy link
Contributor Author

Seems like the places where I added trim, those yaml block doesnt have a dash at the end, is that the actual bug? Made a new commit thats the proper fix, if thats the case.

@guenhter
Copy link
Collaborator

Could you squash the two commits to one. Then I'm happy to merge this.

@alexanderfast
Copy link
Contributor Author

Done. Theyve been squashed and force pushed.

@guenhter guenhter merged commit dc3eef1 into riemers:master Sep 13, 2023
@guenhter
Copy link
Collaborator

@alexanderfast Thx for this contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants