forked from ClusterLabs/crmsh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: pass env to child process explicitly (bsc#1205925)
A bug in python stardard library, python/cpython#100516, make environment variables, `COLUMNS` and `ROWS` to be added at fork. These environment variables may make some of the commands called by crmsh to truncate its output even if those commands are not writing to the terminal. Passing argument `env` explicitly is a workaround for the python bug.
- Loading branch information
1 parent
ad10dad
commit 5b35eac
Showing
4 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Copyright (C) 2008-2011 Dejan Muhamedagic <[email protected]> | ||
# Copyright (C) 2013 Kristoffer Gronlund <[email protected]> | ||
# See COPYING for license information. | ||
|
||
import os | ||
import re | ||
import copy | ||
import subprocess | ||
|
@@ -550,10 +550,13 @@ def do_delete(self, context, node): | |
'usage: delete <node>' | ||
logger.warning('`crm node delete` is deprecated and will very likely be dropped in the near future. It is auto-replaced as `crm cluster remove -c {}`.'.format(node)) | ||
if config.core.force: | ||
rc = subprocess.call(['crm', 'cluster', 'remove', '-F', '-c', node]) | ||
args = ['crm', 'cluster', 'remove', '-F', '-c', node] | ||
else: | ||
rc = subprocess.call(['crm', 'cluster', 'remove', '-c', node]) | ||
return rc == 0 | ||
args = ['crm', 'cluster', 'remove', '-c', node] | ||
return 0 == subprocess.call( | ||
args, | ||
env=os.environ, # bsc#1205925 | ||
) | ||
|
||
@command.wait | ||
@command.completers(compl.nodes, compl.choice(['set', 'delete', 'show']), _find_attr) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters