in ec2instanceconnectcli/EC2InstanceConnectCLI.py [0:0]
def run_command(self, command=None):
"""
Runs the given command in a sub-shell
:param command: Command to invoke
:type command: basestring
:return: Return code for remote command
:rtype: int
"""
if not command:
raise ValueError('Must provide a command')
invocation_proc = Popen(command, shell=True)
while invocation_proc.poll() is None: #sub-process not terminated
time.sleep(0.1)
return invocation_proc.returncode