-
Notifications
You must be signed in to change notification settings - Fork 160
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
Execute source using /bin/bash not /bin/sh #547
base: main
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
@@ -1268,7 +1268,7 @@ def fence_logout(conn, logout_string, sleep=0): | |||
def source_env(env_file): | |||
# POSIX: name shall not contain '=', value doesn't contain '\0' | |||
output = subprocess.check_output("source {} && env -0".format(env_file), shell=True, | |||
executable="/bin/sh") | |||
executable="/bin/bash") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case, the bash´ism should be removed. /bin/bash is not available on all systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine if you replace "source" with "." (tested with bash, dash and sh on FreeBSD):
output = subprocess.check_output(". {} && env -0".format(env_file), shell=True, executable="/bin/sh")
Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/fence-agents-pipeline/job/PR-547/1/input |
It seems like replacing |
I can confirm this still causes issues on Ubuntu 24.04, for what it's worth. I ran into it with the fence_openstack agent. Two good resolutions have been suggested, and it seems that determining which one is better needs to be informed by the intention of compatibility:
To sum up, unless I've misunderstood project goals, this PR looks like the right solution. |
Attempting to execute source in /bin/sh doesn't work if /bin/sh isn't bash