Skip to content

Commit 2b417d5

Browse files
authored
Replace call to which with command (#61)
Command is a more widely available command with similar functionality.
1 parent 5eae74c commit 2b417d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lxc_ssh.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,11 @@ def _set_command_prefix(self):
529529
def _set_version(self):
530530
# LXC v1 uses 'lxc-info', 'lxc-attach' and so on
531531
# LXC v2 uses just 'lxc'
532-
(returncode2, stdout2, stderr2) = self._exec_command("which lxc", None, False)
532+
(returncode2, stdout2, stderr2) = self._exec_command(
533+
"command -v lxc", None, False
534+
)
533535
(returncode1, stdout1, stderr1) = self._exec_command(
534-
"which lxc-info", None, False
536+
"command -v lxc-info", None, False
535537
)
536538
if returncode2 == 0:
537539
self.lxc_version = 2

0 commit comments

Comments
 (0)