Skip to content

Commit b91281e

Browse files
committed
Handle non-string bits in StringCommands.
1 parent 2e4053f commit b91281e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pyinfra/api/command.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from string import Formatter
44

5+
import six
6+
57
from six.moves import shlex_quote
68

79
from .operation_kwargs import get_executor_kwarg_keys
@@ -94,6 +96,9 @@ def _get_all_bits(self, bit_accessor):
9496
if quote:
9597
bit = shlex_quote(bit)
9698

99+
if not isinstance(bit, six.string_types):
100+
bit = '{0}'.format(bit)
101+
97102
all_bits.append(bit)
98103

99104
return all_bits

0 commit comments

Comments
 (0)